Merge pull request #46 from olegz/INT-2009

added documentation clarifying the use of MessageGroup when using POJO-based ReleaseStrategy
This commit is contained in:
Mark Fisher
2011-08-26 17:56:20 -04:00

View File

@@ -231,6 +231,28 @@
aggregation, and false otherwise.</para>
</listitem>
</itemizedlist>
For example:
<programlisting language="java"><![CDATA[public class MyReleaseStrategy {
@ReleaseStrategy
public boolean canMessagesBeReleased(List<Message<?>>) {...}
}]]></programlisting>
<programlisting language="java"><![CDATA[public class MyReleaseStrategy {
@ReleaseStrategy
public boolean canMessagesBeReleased(List<String>) {...}
}]]></programlisting>
<para>
As you can see based on the above signatures, the POJO-based Release Strategy will be passed a <classname>Collection</classname> of unmarked Messages
if you need access to the whole <classname>Message</classname> or <classname>Collection</classname> of payload objects if the type parameter is
anything other than <classname>Message</classname>. Typically this would satisfy the majority of use cases. However if
for some reason you need to access the full <classname>MessageGroup</classname> - which contains <code>unmarked</code> and <code>marked</code> Messages -
then you should simply provide an implementation of the <classname>ReleaseStrategy</classname> interface.
</para>
<para>When the group is released for aggregation, all its unmarked
messages are processed and then marked so they will not be processed