Skip to content

Instantly share code, notes, and snippets.

@knalli
Created February 5, 2014 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knalli/8832138 to your computer and use it in GitHub Desktop.
Save knalli/8832138 to your computer and use it in GitHub Desktop.
Blog: Migration Spring Integration 2.x to 3.x with Jackson2 (finally): http://www.knallisworld.de/blog/2014/02/05/expose-a-java-method-with-amqp-using-spring-integration/
@Service("api")
public class ApiImpl {
public Response handle(Request request) {
// Do some stuff and return a response object
}
}
@Service("api")
public class ApiImpl {
@ServiceActivator
public Response handle(@Payload Request request) {
// Do some stuff and return a response object
}
}
<beans>
<int-amqp:inbound-gateway
connection-factory="connectionFactory"
request-channel="requestChannel"
reply-channel="resultChannel"
error-channel="errorChannel"
queue-names="queue"/>
</beans>
<beans>
<int:channel id="requestChannel"/>
<int:channel id="resultChannel"/>
</beans>
<beans>
<int:channel id="requestChannel"/>
<int:channel id="requestChannelJson"/>
<int:channel id="resultChannel"/>
<int:channel id="resultChannelJson"/>
<int:chain input-channel="requestChannelJson" output-channel="requestChannel">
<int:json-to-object-transformer type="your.package.to.Request"/>
</int:chain>
<int:chain input-channel="resultChannel" output-channel="resultChannelJson">
<int:object-to-json-transformer/>
</int:chain>
</beans>
<beans>
<int:service-activator ref="api" input-channel="requestChannel" output-channel="resultChannel" />
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment