I have just started work on a software which uses IBM MQ for some communication.
As I understand that MQ can be used for many to one communication and one to many communication.
Lets say there are 3 Business applications A, B and C. A wants to send a message using MQ to B and another message to C but A is only using one queue Queue1.
Now my question is if we can define (in MQMD or otherwise) that a certain message is only for B NOT for C, hence only B can retrieve it from Queue1 whenever B is available. If not how can we do this if it is at all possible?
One other thing is can we make a separate queue Queue2 only for A-B communication?
It is better to use separate queues. For example use queue QA2B
for application A to send messages to application B and QA2C
for application A to send messages to application C. This way traffic is separated out and you can administratively restrict application B from receiving message meant for C and vice-versa.
It is possible to use just one queue wherein application A while sending messages sets a message property that says something like "Message is for B" or "Message is for C". Application B uses a selector to match the property value "Message for B" while receiving messages. Similarly application C also uses selector "Message for C" and receives messages. But note if either B or C receives messages without any selector, then messages can go to wrong hands.