如何使用JMS向特定的ibm mq队列发送消息/从特定的ibm mq队列接收消息 [英] How to send/receive Message to/from particular ibm mq queue using JMS

查看:804
本文介绍了如何使用JMS向特定的ibm mq队列发送消息/从特定的ibm mq队列接收消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在使用"onMessage"来监听专用队列中的消息.

Currently I am using ‘onMessage’ to listen dedicated queue for message.

现在新的要求是, 1.不同的供应商会将味精放在单个队列中,我必须按供应商区分味精并将其存储到oracle数据库中. 2.第二个要求是在单个队列上发送回味精,这样特定的供应商就可以接机.

Now new requirement is, 1. different vendor will put msg on single queue, and I have to differentiate the msg by vendor and store into oracle db. 2. Second requirement is to send back msg on single queue so particular vendor will pick up.

我是新来的. 任何回应表示赞赏.

I am new to this. Any response is appreciated.

推荐答案

1)要求您的供应商在消息上设置一个属性,例如供应商名称".然后,您可以使用该属性按供应商进行区分.如果无法在邮件上设置属性,则必须解析邮件有效负载并相应地更新数据库.

1) Ask your vendor to set a property, say "Vendor Name", on the message. Then you can use that property to differentiate by vendor. If property can not be set on a message, then you will have to parse the message payload and update database accordingly.

2)要求您的供应商在他们放入队列的消息上设置JMSReplyTo属性.然后,您可以使用JMSReplyTo的值将答复发送回供应商.此外,您还需要将供应商消息的JMSMessageID设置为应用程序正在发送的回复消息的JMSCorrelationID.这样,您的供应商可以将请求消息与您发送的回复消息相关联.

2) Ask your vendor to set JMSReplyTo property on the message they are putting in the queue. You can then use the value of the JMSReplyTo to send a reply back to vendor. Also you need to take the JMSMessageID of the vendor's message and set it as JMSCorrelationID of the reply message your application is sending. This way your vendor can correlate the request message with the reply message you sent.

希望这会有所帮助.

这篇关于如何使用JMS向特定的ibm mq队列发送消息/从特定的ibm mq队列接收消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆