繁体   English   中英

从Webapp和Apache Camel /并使用MQ,您是否使用jsessionid添加JMS消息?

[英]From a Webapp and with Apache Camel / and using MQ, do you add JMS messages using jsessionid?

我有一个Web应用程序,它将在MQ消息队列上启动消息(比如启动处理)。 我有一个使用Camel Spring DSL定义的消费者和生产者配置。 我想从Web应用程序中推送消息,只有该会话和客户端才能获得响应。 我可以使用jsessionid和其他一些随机消息ID来设置消息,以便只有该客户端才能获得响应吗?

例如Imagine Camel Spring DSL xml配置:

  <route id="webRequestToInRoute">
      <to uri="activemq:queue:inbox :::: here I want to getJsessionId() as the message ... name?"/>
  </route>

更重要的是,我可以通过浏览器与骆驼休息服务之间的通信方式到JMS路由,主要是为了拉动状态?

Web应用程序会话发布消息

  1. 将消息上的JMSReplyTo头设置为:temp-queue://ORDER.$jSessionId
  2. 在temp-queue上设置一个使用者://ORDER.$jSessionId
  3. 发送到 - > queue://PROCESS.ORDER

在REST服务上

  1. 从queue://PROCESS.ORDER消费
  2. 用消息做事
  3. 发布对temp-queue的响应://ORDER.$jSessionId

一旦不再有消息,消费者或生产者,经纪人将自动删除临时队列,因此没有清理新手

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM