Queued publish/subscribe command messages
An application can use MQRFH2 command messages to control a queued publish/subscribe application.
An application that is using MQRFH2 for publish/subscribe can send the following command messages to the SYSTEM.BROKER.CONTROL.QUEUE:- Delete Publication message
- Deregister Subscriber message
- Publish message
- Register Subscriber message
- Request Update message
If we are writing queued publish/subscribe applications, we must understand these messages, the queue manager response message, and the message descriptor ( MQMD); see the following information:
- Queue Manager Response message
- MQMD settings for publications forwarded by a queue manager
- MQMD settings in queue manager response messages
- Publish/subscribe reason codes
The commands are contained in a psc folder in the NameValueData field of the MQRFH2 header. The message that can be sent by a broker in response to a command message is contained in a pscr folder.
The descriptions of each command list the properties that can be contained in a folder. Unless otherwise specified, the properties are optional and can occur only once.
- Names of properties are shown as <Command>.
- Values must be in string format, for example: Publish.
- A string constant representing the value of a property is shown in parentheses, for example: (MQPSC_PUBLISH).
- String constants are defined in the header file cmqpsc.h which is supplied with the queue manager.
- Delete Publication message
The Delete Publication command message is sent to a queue manager from a publisher, or from another queue manager, to tell the queue manager to delete any retained publications for the specified topics. - Deregister Subscriber message
The Deregister Subscriber command message is sent to a queue manager by a subscriber, or by another application on behalf of a subscriber, to indicate that it no longer wants to receive messages matching the given parameters. - Publish message
The Publish command message is put to a queue, or from a queue manager to a subscriber, to publish information on a specified topic or topics. - Register Subscriber message
The Register Subscriber command message is sent to a queue manager by a subscriber, or by another application on behalf of a subscriber, to indicate that it wants to subscribe to one or more topics at a subscription point. A message content filter can also be specified. - Request Update message
The Request Update command message is sent from a subscriber to a queue manager, to request the current retained publications for the specified topic and subscription point that match the given (optional) filter. - Queue Manager Response message
A Queue Manager Response message is sent from a queue manager to the ReplyToQ of a publisher or a subscriber, to indicate the success or failure of a command message received by the queue manager if the command message descriptor specified that a response is required. - Publish/subscribe reason codes
These reason codes might be returned in the Reason field of a publish/subscribe response <pscr> folder. Constants that can be used to represent these codes in the C or C++ programming languages are also listed. - MQMD settings in command messages to the queue manager
Applications that send command messages to the queue manager use the following settings of fields in the message descriptor (MQMD). Fields that are left as the default value, or can be set to any valid value in the usual way, are not listed here. - MQMD settings for publications forwarded by a queue manager
A queue manager uses these settings of fields in the message descriptor (MQMD) when it sends a publication to a subscriber. All other fields in the MQMD are set to their default values. - MQMD settings in queue manager response messages
A queue manager uses these settings of fields in the message descriptor (MQMD) when sending a reply to a publication message. All other fields in the MQMD are set to their default values.
Parent topic: MQI applications reference