[英]Spring Integration - How to create the adapters programmatically?
I am implementing spring-integration based application where i need to send messages (POJO) to ActiveMQ queues dynamically (based on message params). 我正在实现基于弹簧集成的应用程序,在该应用程序中,我需要动态地(基于消息参数)向ActiveMQ队列发送消息(POJO)。 What is the best way to implement this using spring integration concepts ?
使用spring集成概念实现此目的的最佳方法是什么?
Eg, The request message (id:123, processor:ABC) should be sent to ABC.REQUEST queue and response message should be received from ABC.RESPONSE queue. 例如,请求消息(id:123,处理器:ABC)应发送到ABC.REQUEST队列,并且应从ABC.RESPONSE队列接收响应消息。 Similarly the request message (id:456, processor:XYZ) should be sent to XYZ.REQUEST queue and response message should be received from XYZ.RESPONSE queue.
同样,应将请求消息(id:456,处理器:XYZ)发送到XYZ.REQUEST队列,并从XYZ.RESPONSE队列接收响应消息。
You don't need to programmatically create them programmatically, you can use dynamic destinations. 您不需要以编程方式创建它们,可以使用动态目标。
See request-destination-expression
and reply-destination-expression
in the documentation . 请参阅文档中的
request-destination-expression
和reply-destination-expression
。
Something like... 就像是...
request-destination-expression="payload.processor + '.REQUEST'"
reply-destination-expression="payload.processor + '.RESPONSE'"
...should do it. ...应该这样做。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.