From c04cfc668a881850f89c1b5fd4a3ee098475d4c2 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Wed, 20 Nov 2013 17:47:35 -0500 Subject: [PATCH] INT-3143 Doc Polishing JIRA: JIRA: https://jira.springsource.org/browse/INT-3143 Also increase the timeout on an event test. --- ...ventOutboundChannelAdapterParserTests.java | 8 +++-- src/reference/docbook/mongodb.xml | 34 ++++++++++--------- src/reference/docbook/whats-new.xml | 10 ++++-- 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventOutboundChannelAdapterParserTests.java b/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventOutboundChannelAdapterParserTests.java index 5121ad0040..638688b5a3 100644 --- a/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventOutboundChannelAdapterParserTests.java +++ b/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventOutboundChannelAdapterParserTests.java @@ -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() { + @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() { + @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() { + @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() { + @Override public void onApplicationEvent(ApplicationEvent event) { Object source = event.getSource(); if (source instanceof Message){ diff --git a/src/reference/docbook/mongodb.xml b/src/reference/docbook/mongodb.xml index fa2da4d13b..d08bd035c2 100644 --- a/src/reference/docbook/mongodb.xml +++ b/src/reference/docbook/mongodb.xml @@ -113,28 +113,30 @@ - MongoDbMessageStore uses custom MappingMongoConverter implementation - on background to store Messages to MongoDB documents and there is some limitations - for properties (payload and headers values) of provided Message. - For example ErrorMessage can't be converted to the MongoDB document, because it has an - Exception property, which is recursive by nature. And there is no ability to configure - some custom converters for complex domain payloads or headers values. - To achieve these capabilities, the separate MongoDB MessageStore implementation has been + The MongoDbMessageStore uses a custom MappingMongoConverter implementation + to store Messages as MongoDB documents and there are some limitations + for the properties (payload and header values) of the Message. + For example an ErrorMessage can't be converted to the MongoDB document, because it has an + Exception property, where the cause property is infintely recursed. Also, there is no ability to + configure + custom converters for complex domain payloads or header values. + To achieve these capabilities, an alternative MongoDB MessageStore implementation has been introduced; see next paragraph. - Spring Integration 3.0 introduced ConfigurableMongoDbMessageStore - + Spring Integration 3.0 introduced the ConfigurableMongoDbMessageStore - MessageStore and MessageGroupStore implementation. - This class can apply as one of constructor argument MongoTemplate, with which you can provide - some custom WriteConcern, for example. Another constructor requires - MappingMongoConverter, alongside with MongoDbFactory, - which allows to provide some custom conversions for Messages and their properties. - Note, by default ConfigurableMongoDbMessageStore uses standard Java serialization - to write/read Messages to/from MongoDB and relies on default values of other - properties from MongoTemplate, which is built from provided + This class can receive, as a constructor argument, a MongoTemplate, with which you can + configure with a + custom WriteConcern, for example. Another constructor requires a + MappingMongoConverter, and a MongoDbFactory, + which allows you to provide some custom conversions for Messages and their properties. + Note, by default, the ConfigurableMongoDbMessageStore uses standard Java serialization + to write/read Messages to/from MongoDB and relies on default values for other + properties from MongoTemplate, which is built from the provided MongoDbFactory and MappingMongoConverter. - The default name for collection of ConfigurableMongoDbMessageStore is + The default name for the collection stored by the ConfigurableMongoDbMessageStore is configurableStoreMessages. It is recommended to use this implementation for robust and flexible solutions. The MongoDbMessageStore remains for backward compatibility and may be removed in future releases. diff --git a/src/reference/docbook/whats-new.xml b/src/reference/docbook/whats-new.xml index b7d265dafd..520b7c76c0 100644 --- a/src/reference/docbook/whats-new.xml +++ b/src/reference/docbook/whats-new.xml @@ -180,9 +180,13 @@
MongoDB support: New ConfigurableMongoDbMessageStore - To provide more robust and flexible implementation of MessageStore - for MongoDB support has been introduced new ConfigurableMongoDbMessageStore - component. It doesn't have backward compatibility, but it is recommended to use it for new applications. + In addition to the existing eMongoDbMessageStore, a new + ConfigurableMongoDbMessageStore has been introduced. + This provides a more robust and flexible implementation of MessageStore + 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 for more information.