2
votes

I have the following task, that involves ibm message queue:

Exists an application(JMS client) that gets messages from input queue Q1 and puts messages to Q2. There are several application clients that put messages to Q1. Clients specify correlation id for each message. Application retrieve id from the message received from Q1, creates new output message, adds retrieved id and put the message into Q2. Then each client retrieves only its own message, based on correlation id.

My questions is:

If client doesn't specify any id, he reads all the messages from queue. I want a restriction, that forbids from reading the queue when no correlation id is specified.

Is this possible to accomplish using ibm message queue only? If not any other suggestions.

1

1 Answers

4
votes

Have you considered using a temporary queue for the reply queue (Q2)? In this pattern each application creates a temporary queue for its own use. All applications put to Q1 and set the ReplyToQ in the MQMD to the name of their temporary queue.

The application processing messages on Q1 puts the response to the specified ReplyToQ instead of putting them all to Q2 with a given correlation ID.

This scenario ought to avoid errant applications accidentally consuming messages from the queue not intended for them.