Publish message
When you are using the Publication node with an MQ pub/sub broker, a Publish command message is sent from a publisher to an integration node to publish information on a specified topic or topics.
This message is sent to the input queue of a message flow that contains a Publication node. Authority to put a message onto this queue, and to publish on the specified topic or topics, is necessary.
If the user has authority on some, but not all, topics, only those topics are published; a warning response indicates which topics are not published.
If there are any matching subscriptions, the MQ pub/sub broker forwards the Publish message to the subscriber queues that are defined in the corresponding WebSphere® MQ subscriptions.
See Broker Response message for details of the message descriptor (MQMD) parameters needed when sending a command message to the integration node.
The MQ pub/sub broker forwards the Publish message to other queue managers in the network that have matching subscriptions, unless it is a local publication.
Publication
data, if any, is included in the body of the message. The data can
be described in an <mcd>
folder in the NameValueData field
of the MQRFH2 header.
Properties
- <Command> (MQPSC_COMMAND)
- The value is Publish(MQPSC_PUBLISH).
This property must be specified.
- <Topic> (MQPSC_TOPIC)
- The value is a string that contains a topic that categorizes this
publication. No wildcard characters are allowed.
This property must be specified, and can optionally be repeated for as many topics as needed.
- <SubPoint> (MQPSC_SUBSCRIPTION_POINT)
- The subscription point on which the publication is published.
This property should not be included in a publication message sent to the integration node but is added automatically to publication messages by the integration node before those messages are sent to any appropriate subscribers. The value of the <SubPoint> property is the value of the Subscription Point attribute of the Publication node that is handling the publishing.
- <PubOpt> (MQPSC_PUBLICATION_OPTION)
- The publication options property can take the following values:
You can have more than one publication option by introducing additional <PubOpt> elements.
The default, if this property is omitted, is that no publication options are set.
- <PubTime> (MQPSC_PUBLISH_TIMESTAMP)
- The value is an optional publication timestamp set by the publisher.
It is 16 characters long with format:
YYYYMMDDHHMMSSTH
using Universal Time. This information is not checked by the integration node before being sent to the subscribers.
- <SeqNum> (MQPSC_SEQUENCE_NUMBER)
- The value is an optional sequence number set by the publisher.
It should be incremented by 1 with each publication. However, this is not checked by the integration node, which merely transmits this information to subscribers.
If publications on the same topic are published to different interconnected integration node, it is the responsibility of the publishers to ensure that sequence numbers, if used, are meaningful.
- <QMgrName> (MQPSC_Q_MGR_NAME)
- The value is a string containing the name of the queue manager
for the publisher's subscriber queue, in applications where the publisher
is also a subscriber (see OtherSubsOnly).
If this property is omitted, the default is the ReplyToQMgr name in the message descriptor (MQMD). If the resulting name is blank, it defaults to the name of the integration node's queue manager.
- <QName> (MQPSC_Q_NAME)
- The value is a string containing the name of the publisher's subscriber
queue, in applications where the publisher is also a subscriber (see OtherSubsOnly).
If this property is omitted, the default is the ReplyToQ name in the message descriptor (MQMD), which must not be blank if OtherSubsOnly is set.
Example
Here are some examples of NameValueData for a Publish command message.
<psc>
<Command>Publish</Command>
<Topic>Sport/Soccer/Event/MatchStarted</Topic>
</psc>
<psc>
<Command>Publish</Command>
<PubOpt>RetainPub</PubOpt>
<Topic>Sport/Soccer/State/LatestScore/Team1 Team2</Topic>
</psc>