INT-3092, INT-3042: Doc: Jacksons, Resequencer
JIRA: https://jira.springsource.org/browse/INT-3042 https://jira.springsource.org/browse/INT-3092
This commit is contained in:
committed by
Gary Russell
parent
77b0917190
commit
937ac9647a
@@ -49,7 +49,6 @@
|
||||
correlation-strategy="correlationStrategyBean" ]]><co id="resxml11-co" linkends="resxml11" /><![CDATA[
|
||||
correlation-strategy-method="correlate" ]]><co id="resxml12-co" linkends="resxml12" /><![CDATA[
|
||||
correlation-strategy-expression="headers['foo']" ]]><co id="resxml13-co" linkends="resxml13" /><![CDATA[
|
||||
|
||||
release-strategy="releaseStrategyBean" ]]><co id="resxml14-co" linkends="resxml14" /><![CDATA[
|
||||
release-strategy-method="release" ]]><co id="resxml15-co" linkends="resxml15" /><![CDATA[
|
||||
release-strategy-expression="size() == 10" ]]><co id="resxml16-co" linkends="resxml16" /><![CDATA[
|
||||
@@ -78,33 +77,9 @@
|
||||
</callout>
|
||||
|
||||
<callout arearefs="resxml5-co" id="resxml5">
|
||||
|
||||
|
||||
<para>Whether to send out ordered sequences as soon as they are
|
||||
available, or only after the whole message group arrives.
|
||||
<emphasis>Optional (false by default)</emphasis>.</para>
|
||||
|
||||
If this flag is not specified (so a complete sequence is defined by the sequence headers) then it may make sense to provide a custom
|
||||
|
||||
<interfacename>Comparator</interfacename>
|
||||
|
||||
to be used to order the messages when sending (use the XML attribute
|
||||
|
||||
<literal>comparator</literal>
|
||||
|
||||
to point to a bean definition). If
|
||||
|
||||
<literal>release-partial-sequences</literal>
|
||||
|
||||
is true then there is no way with a custom comparator to define a partial sequence. To do that you would have to provide a
|
||||
|
||||
<literal>release-strategy</literal>
|
||||
|
||||
(also a reference to another bean definition, either a POJO or a
|
||||
|
||||
<interfacename>ReleaseStrategy</interfacename>
|
||||
|
||||
).
|
||||
</callout>
|
||||
|
||||
<callout arearefs="resxml6-co" id="resxml6">
|
||||
|
||||
@@ -229,7 +229,9 @@ public class Kid {
|
||||
<para>
|
||||
Beginning with version 3.0, the <code>object-mapper</code> attribute references an instance of a new
|
||||
strategy interface <interfacename>JsonObjectMapper</interfacename>. This abstraction allows multiple
|
||||
implementations of json mappers to be used. Implementations that wrap Jackson 1.x and Jackson 2 are
|
||||
implementations of json mappers to be used. Implementations that wrap
|
||||
<ulink url="http://jackson.codehaus.org">Jackson 1.x</ulink> and
|
||||
<ulink url="https://github.com/FasterXML">Jackson 2</ulink> are
|
||||
provided, with the version being detected on the classpath. These classes are
|
||||
<classname>JacksonJsonObjectMapper</classname> and <classname>Jackson2JsonObjectMapper</classname>.
|
||||
</para>
|
||||
@@ -238,6 +240,24 @@ public class Kid {
|
||||
instead of a <interfacename>JsonObjectMapper</interfacename>. This will be removed in a future release.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
<important>
|
||||
If there are requirements to use both Jackson libraries in the same application, keep in mind that
|
||||
before version 3.0, the JSON transformers used only Jackson 1.x and, from 3.0 on, the framework will
|
||||
select Jackson 2 by default, if both are on the classpath.
|
||||
So, to avoid unexpected issues with Jackson's mapping features, when using annotations, there may be
|
||||
a need to apply annotations from both Jacksons on domain classes:
|
||||
<programlisting language="java"><![CDATA[@org.codehaus.jackson.annotate.JsonIgnoreProperties(ignoreUnknown=true)
|
||||
@com.fasterxml.jackson.annotation.JsonIgnoreProperties(ignoreUnknown=true)
|
||||
public class Foo {
|
||||
|
||||
@org.codehaus.jackson.annotate.JsonProperty("fooBar")
|
||||
@com.fasterxml.jackson.annotation.JsonProperty("fooBar")
|
||||
public Object bar;
|
||||
|
||||
}]]></programlisting>
|
||||
</important>
|
||||
</para>
|
||||
<para>
|
||||
You may wish to consider using a <interfacename>FactoryBean</interfacename> or simple factory
|
||||
method to create the <classname>JsonObjectMapper</classname> with
|
||||
|
||||
Reference in New Issue
Block a user