DATAKV-25
+ add error handler setter on the container + improve docs
This commit is contained in:
16
src/docbkx/appendix/appendix-schema.xml
Normal file
16
src/docbkx/appendix/appendix-schema.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE preface PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
|
||||
|
||||
<appendix id="appendix-schema">
|
||||
<title>Spring Data Key Value Schema(s)</title>
|
||||
|
||||
<para>Spring Data - Redis support</para>
|
||||
<programlisting><xi:include href="../../../spring-data-redis/src/main/resources/org/springframework/data/keyvalue/redis/config/spring-redis-1.0.xsd" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<xi:fallback>
|
||||
<para><emphasis>FIXME: REDIS SCHEMA LOCATION/NAME CHANGED</emphasis></para>
|
||||
</xi:fallback>
|
||||
</xi:include>
|
||||
</programlisting>
|
||||
|
||||
</appendix>
|
||||
10
src/docbkx/appendix/introduction.xml
Normal file
10
src/docbkx/appendix/introduction.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<partintro>
|
||||
<title>Document structure</title>
|
||||
|
||||
<para>
|
||||
Various appendixes outside the reference documentation.
|
||||
</para>
|
||||
|
||||
<para><xref linkend="appendix-schema"/> defines the schemas provided by Spring Data
|
||||
Key Value.</para>
|
||||
</partintro>
|
||||
@@ -50,6 +50,13 @@
|
||||
<xi:include href="reference/riak.xml"/>
|
||||
</part>
|
||||
|
||||
<part id="appendixes">
|
||||
<title>Appendixes</title>
|
||||
|
||||
<xi:include href="appendix/introduction.xml"/>
|
||||
<xi:include href="appendix/appendix-schema.xml"/>
|
||||
</part>
|
||||
|
||||
<!--
|
||||
<part id="resources">
|
||||
<title>Other Documentation</title>
|
||||
|
||||
@@ -40,7 +40,7 @@ con.publish(msg, channel);
|
||||
|
||||
// send message through RedisTemplate
|
||||
RedisTemplate template = ...
|
||||
template.publish("hello!", "world");]]></programlisting>
|
||||
template.convertAndSend("hello!", "world");]]></programlisting>
|
||||
</section>
|
||||
|
||||
<section id="redis:pubsub:subscribe">
|
||||
@@ -147,6 +147,27 @@ template.publish("hello!", "world");]]></programlisting>
|
||||
<emphasis>no</emphasis> Redis dependencies at all. It truly is a POJO that
|
||||
we will make into an MDP via the following configuration.</para>
|
||||
|
||||
<programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<lineannotation>xmlns:redis="http://www.springframework.org/schema/redis"</lineannotation>
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
<lineannotation>http://www.springframework.org/schema/redis http://www.springframework.org/schema/redis/spring-redis.xsd"</lineannotation>>
|
||||
|
||||
<!-- the default ConnectionFactory -->
|
||||
<redis:listener-container>
|
||||
<!-- the method attribute can be skipped as the default method name is "handleMessage" -->
|
||||
<redis:listener ref="listener" method="handleMessage" channel="chatroom" />
|
||||
</redis:listener-container>
|
||||
|
||||
<bean class="redisexample.DefaultMessageDelegate"/>
|
||||
...
|
||||
<beans>
|
||||
</programlisting>
|
||||
|
||||
<para>The example above uses the Redis namespace to declare the message listener container and automatically register the POJOs as listeners. The full blown, <emphasis>beans</emphasis> definition
|
||||
is displayed below:</para>
|
||||
|
||||
<programlisting language="xml"><lineannotation><!-- this is the Message Driven POJO (MDP) --></lineannotation>
|
||||
<emphasis role="bold"><bean id="messageListener" class="org.springframework.data.keyvalue.redis.listener.adapter.MessageListenerAdapter"></emphasis>
|
||||
<constructor-arg>
|
||||
|
||||
@@ -259,7 +259,7 @@
|
||||
private StringRedisTemplate redisTemplate;
|
||||
|
||||
public void addLink(String userId, URL url) {
|
||||
redisTemplate.getListOps().leftPush(userId, url.toExternalForm());
|
||||
redisTemplate.opsForList().leftPush(userId, url.toExternalForm());
|
||||
}
|
||||
}]]></programlisting>
|
||||
<para>As with the other Spring templates, <classname>RedisTemplate</classname> and <classname>StringRedisTemplate</classname> allow the developer to talk directly to Redis through
|
||||
@@ -276,6 +276,8 @@
|
||||
});
|
||||
}]]></programlisting>
|
||||
</section>
|
||||
|
||||
<xi:include href="redis-messaging.xml"/>
|
||||
|
||||
<section id="redis:support">
|
||||
<title>Support Classes</title>
|
||||
@@ -318,8 +320,6 @@
|
||||
development to production environments transparent and highly increases testability (the Redis implementation can just as well be replaced with an in-memory one).</para>
|
||||
</section>
|
||||
|
||||
<xi:include href="redis-messaging.xml"/>
|
||||
|
||||
<section id="redis:future">
|
||||
<title>Roadmap ahead</title>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user