INT-3143 Doc Polishing

JIRA: JIRA: https://jira.springsource.org/browse/INT-3143

Also increase the timeout on an event test.
This commit is contained in:
Gary Russell
2013-11-20 17:47:35 -05:00
parent d2bb90f7e0
commit c04cfc668a
3 changed files with 31 additions and 21 deletions

View File

@@ -20,9 +20,9 @@ import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEvent;
@@ -71,6 +71,7 @@ public class EventOutboundChannelAdapterParserTests {
@Test
public void validateUsage() {
ApplicationListener<?> listener = new ApplicationListener<ApplicationEvent>() {
@Override
public void onApplicationEvent(ApplicationEvent event) {
Object source = event.getSource();
if (source instanceof Message){
@@ -91,6 +92,7 @@ public class EventOutboundChannelAdapterParserTests {
public void withAdvice() {
receivedEvent = false;
ApplicationListener<?> listener = new ApplicationListener<ApplicationEvent>() {
@Override
public void onApplicationEvent(ApplicationEvent event) {
Object source = event.getSource();
if (source instanceof Message){
@@ -112,6 +114,7 @@ public class EventOutboundChannelAdapterParserTests {
public void testInsideChain() {
receivedEvent = false;
ApplicationListener<?> listener = new ApplicationListener<ApplicationEvent>() {
@Override
public void onApplicationEvent(ApplicationEvent event) {
Object source = event.getSource();
if (source instanceof Message){
@@ -128,12 +131,13 @@ public class EventOutboundChannelAdapterParserTests {
Assert.assertTrue(receivedEvent);
}
@Test(timeout=2000)
@Test(timeout=10000)
public void validateUsageWithPollableChannel() throws Exception {
receivedEvent = false;
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext("EventOutboundChannelAdapterParserTestsWithPollable-context.xml", EventOutboundChannelAdapterParserTests.class);
final CyclicBarrier barier = new CyclicBarrier(2);
ApplicationListener<?> listener = new ApplicationListener<ApplicationEvent>() {
@Override
public void onApplicationEvent(ApplicationEvent event) {
Object source = event.getSource();
if (source instanceof Message){

View File

@@ -113,28 +113,30 @@
</para>
<important>
<para>
<classname>MongoDbMessageStore</classname> uses custom <classname>MappingMongoConverter</classname> implementation
on background to store <interfacename>Message</interfacename>s to MongoDB documents and there is some limitations
for properties (<code>payload</code> and <code>headers</code> values) of provided <interfacename>Message</interfacename>.
For example <classname>ErrorMessage</classname> can't be converted to the MongoDB document, because it has an
<classname>Exception</classname> property, which is recursive by nature. And there is no ability to configure
some custom converters for complex domain <code>payload</code>s or <code>headers</code> values.
To achieve these capabilities, the separate MongoDB <interfacename>MessageStore</interfacename> implementation has been
The <classname>MongoDbMessageStore</classname> uses a custom <classname>MappingMongoConverter</classname> implementation
to store <interfacename>Message</interfacename>s as MongoDB documents and there are some limitations
for the properties (<code>payload</code> and <code>header</code> values) of the <interfacename>Message</interfacename>.
For example an <classname>ErrorMessage</classname> can't be converted to the MongoDB document, because it has an
<classname>Exception</classname> property, where the cause property is infintely recursed. Also, there is no ability to
configure
custom converters for complex domain <code>payload</code>s or <code>header</code> values.
To achieve these capabilities, an alternative MongoDB <interfacename>MessageStore</interfacename> implementation has been
introduced; see next paragraph.
</para>
</important>
<para>
<emphasis>Spring Integration 3.0</emphasis> introduced <classname>ConfigurableMongoDbMessageStore</classname> -
<emphasis>Spring Integration 3.0</emphasis> introduced the <classname>ConfigurableMongoDbMessageStore</classname> -
<interfacename>MessageStore</interfacename> and <interfacename>MessageGroupStore</interfacename> implementation.
This class can apply as one of constructor argument <classname>MongoTemplate</classname>, with which you can provide
some custom <classname>WriteConcern</classname>, for example. Another constructor requires
<classname>MappingMongoConverter</classname>, alongside with <interfacename>MongoDbFactory</interfacename>,
which allows to provide some custom conversions for <interfacename>Message</interfacename>s and their properties.
Note, by default <classname>ConfigurableMongoDbMessageStore</classname> uses standard Java serialization
to write/read <interfacename>Message</interfacename>s to/from MongoDB and relies on default values of other
properties from <classname>MongoTemplate</classname>, which is built from provided
This class can receive, as a constructor argument, a <classname>MongoTemplate</classname>, with which you can
configure with a
custom <classname>WriteConcern</classname>, for example. Another constructor requires a
<classname>MappingMongoConverter</classname>, and a <interfacename>MongoDbFactory</interfacename>,
which allows you to provide some custom conversions for <interfacename>Message</interfacename>s and their properties.
Note, by default, the <classname>ConfigurableMongoDbMessageStore</classname> uses standard Java serialization
to write/read <interfacename>Message</interfacename>s to/from MongoDB and relies on default values for other
properties from <classname>MongoTemplate</classname>, which is built from the provided
<interfacename>MongoDbFactory</interfacename> and <classname>MappingMongoConverter</classname>.
The default name for collection of <classname>ConfigurableMongoDbMessageStore</classname> is
The default name for the collection stored by the <classname>ConfigurableMongoDbMessageStore</classname> is
<code>configurableStoreMessages</code>. It is recommended to use this implementation for robust and flexible solutions.
The <classname>MongoDbMessageStore</classname> remains for backward compatibility and may be removed in future releases.
</para>

View File

@@ -180,9 +180,13 @@
<section id="3.0-configurable-mongo-MS">
<title>MongoDB support: New ConfigurableMongoDbMessageStore</title>
<para>
To provide more robust and flexible implementation of <interfacename>MessageStore</interfacename>
for MongoDB support has been introduced new <classname>ConfigurableMongoDbMessageStore</classname>
component. It doesn't have backward compatibility, but it is recommended to use it for new applications.
In addition to the existing <classname>eMongoDbMessageStore</classname>, a new
<classname>ConfigurableMongoDbMessageStore</classname> has been introduced.
This provides a more robust and flexible implementation of <interfacename>MessageStore</interfacename>
for MongoDB.
It does not have backward compatibility, with the existing store,
but it is recommended to use it for new applications. Existing applications can use it, but messages
in the old store will not be available.
See <xref linkend="mongodb"/> for more information.
</para>
</section>