Think of MQ as a post office. When you receive a letter, the post office does not interfere with anything inside (payload), and if it changes the look, it only changes the routing information. If you want to sort incoming mail for different recipients, then someone who sends it must put data against which sorting criteria act on the outside of the envelope. If this does not work, you should open the envelope and see the name of the recipient, department or something else on the papers inside.
Your MQ message is an envelope. Sorting criteria can be different queue names, a message property, a message header property, or something in the payload. But if the sender does not explicitly specify the name of the destination queue based on the selection criteria or does not set the message or header property, the only option is to check the payload and understand it.
If you need to check the payload, this is the perfect scenario for IBM Integration Broker. But you can also write an application to perform this function. Very often this is done by the Dispatch application, which receives the message, determines where it goes, then puts it in another queue and COMMIT GET and PUT operations. But if the distribution application needs to parse XML to determine the correct queue, the message must be parsed twice — once by the dispatcher, once by the application.
source share