0
votes

We are a team of developers that use the same WebSphere MQ queue to write and read messages. Because we use the same queue some messages are picked up by a reader from another machine. Is there a way to filter the messages that are read from the queue, by the Environment.MachineName of the sender?

This is what I tried fo far by using MQMessage.GroupId:

  1. Set GroupId on the messages that are PUT.
  2. Set MQGetMessageOptions.MatchOptions = MQC.MQMO_MATCH_GROUP_ID for the GET and set GroupId on message.

Basically I am trying to make a group for each workstation that uses the queue. Unfortunatelly this doesn't work, no messages are read by the GET.

Is there another option to implement what I need? I am using WebSphere MQ 7.0.1 and amqmdnet.dll WebSphere MQ Classes for .NET.

Thanks in advance, Radu

1
There is this feature called Selectors but I haven't found the corresponding .NET components, yet. www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.0.1/…Radu Negrila
Have you found a solution eventually?Ofer Zelig

1 Answers

0
votes

OMG. Don't do this - it is a horrible design. The better solution is to create many queues, so that each queue handles a unique function. i.e.

  • BANK.ACCOUNT.LIST
  • BANK.ACCOUNT.DEPOSIT
  • BANK.ACCOUNT.WITHDRAWAL
  • BANK.ACCOUNT.TRANSFER

There is absolutely no reason to have several applications put messages to the same queue if the messages are for different purposes.