java - Spring Integration AMQP - Wrong JSON type on Response -
i'm using spring integration & si amqp 3.0.0-release.
i have simple request-response on amqp between 2 si instances.
i'm finding when response arrives on requesting server, si attempting deserialize response using the request object's type, not response object.
ie., given gateway interface of:
public analyticsreponse getanalyticsreport(entitymessage objecturi);
i find though correct json of analyticsresponse
arrives on server, si attempting deserialize entitymessage
, failing.
i've debugged through, , suspect cause responding side copying inbound json__typeid__
header, rather supplying it's own. however, can't see i've misconfigured this.
here's config -- have done wrong?
requesting side:
<int:channel id="analytics.reports.requests.channel" /> <int:channel id="analytics.reports.responses.channel" /> <int:gateway service-interface="com.project.analytics.gateway.analyticsreportinggateway"> <int:method name="getanalyticsreport" request-channel="analytics.reports.requests.channel" reply-channel="analytics.reports.responses.channel"/> </int:gateway> <int-amqp:outbound-gateway request-channel="analytics.reports.requests.channel" reply-channel="analytics.reports.responses.channel" exchange-name="analytics.reports.exchange" amqp-template="amqptemplate" />
responding side:
<int:channel id="analytics.reports.requests.channel" /> <int:channel id="analytics.reports.responses.channel" /> <int-amqp:inbound-gateway request-channel="analytics.reports.requests.channel" reply-channel="analytics.reports.responses.channel" queue-names="analytics.reports.queue" connection-factory="rabbitconnectionfactory" message-converter="jsonmessageconverter"/> <int:service-activator input-channel="analytics.reports.requests.channel" output-channel="analytics.reports.responses.channel" ref="analyticsreporter" method="getanalytics"/> <bean class="com.project.analytics.reporters.simpleanalyticsreporter" id="analyticsreporter"/> public class simpleanalyticsreporter { @sneakythrows public analyticsreponse getanalytics(entitymessage message) { return new analyticsreponse("hello"); }
as far aren't interested in org.springframework.integration.mapping.support.jsonheaders
, because use jsonmessageconverter
, should filter them (<header-filter>
) or ignore amqp headers (mapped-request-headers="-"
or mapped-reply-headers="-"
).
however see wasn't right yesterday (https://jira.springsource.org/browse/int-3285) , reopen issue revise how can deal standard headers default allow work similar scenarios. thank you!
Comments
Post a Comment