Reply-to queues for request-reply messaging through a IBM MQ link
Reply-to queues indicate to a receiving application where a reply should be sent. You can use reply-to queues for point-to-point request messages (queues) and for publish/subscribe request messages.
The reply-to queue might be a predefined queue or a dynamically created temporary or permanent queue. If it is a dynamic queue, then it might have a unique name that is generated by IBM MQ. WebSphere® Application Server messaging technology has the same concept of a temporary queue for replies, and generates a queue name of up to 48 characters to comply with the queue-name length limitation for IBM MQ.
Deciding to use reply-to queues is part of application design (see 设计应用程序以与 IBM MQ 进行互操作). Your sending application must contain a definition of where replies are to be sent and attach this information to its messages. The replying application uses this data in the received message to discover the name of the queue to which to reply.
There are two fields in the JMS API that are used for sharing information about the destination to which a message is sent (JMSDestination) and the destination to which replies should be sent (JMSReplyTo). The JMSReplyTo field allows a response message to be returned if required. It contains enough detail for the receiving application to send a response message to the intended queue or topic so that it can be read by an application associated with the sender of the request. The JMSReplyTo field of a JMS message passing from a service integration bus to IBM MQ (or from IBM MQ to a service integration bus) is automatically mapped so that a consuming application in IBM MQ can reply to the original WebSphere Application Server application.