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.

This message is sent to SYSTEM.BROKER.CONTROL.QUEUE, the queue manager's control queue. Authority to put a message to this queue is required, in addition to access authority for the topic in the request update; this is set by the queue manager's system administrator.

This command is normally used if the subscriber specified the option PubOnReqOnly when it registered. If the queue manager has any matching retained publications, they are sent to the subscriber. If the queue manager has no matching retained publications, the request fails with return code MQRCCF_NO_RETAINED_MSG. The requester must have previously registered a subscription with the same Topic, SubPoint, and Filter values.

Parent topic: Queued publish/subscribe command messages


Properties

    Command (MQPSC_COMMAND)
    The value is ReqUpdate (MQPSC_REQUEST_UPDATE). This property must be specified.

    Topic (MQPSC_TOPIC)
    The value is the topic that the subscriber is requesting; wildcard characters are allowed.

    This property must be specified, but only one occurrence is allowed in this message.

    SubPoint (MQPSC_SUBSCRIPTION_POINT)
    The value is the subscription point to which the subscription is attached.

    If this property is omitted, the default subscription point is used.

    Filter (MQPSC_FILTER)
    The value is an ESQL expression that is used as a filter on the contents of publication messages. If a publication on the specified topic matches the filter, it is sent to the subscriber.

    The <Filter> property should have the same value as that specified on the original subscription for which we are now requesting an update.

    If this property is omitted, no content filtering takes place.

    RegOpt (MQPSC_REGISTRATION_OPTION)
    The registration options property can take the following value:

      CorrelAsId   
      (MQPSC_CORREL_ID_AS_IDENTITY)

      The CorrelId in the message descriptor (MQMD), which must not be zero, is used when sending matching publications to the subscriber queue.

      None   
      (MQPSC_NONE)

      All options take their default values. This has the same effect as omitting the <RegOpt> property. If other options are specified at the same time, None is ignored.

      VariableUserId   
      (MQPSC_VARIABLE_USER_ID)

      When specified the identity of the subscriber (queue, queue manager, and correlid) is not restricted to a single userid. This differs from the existing behavior of the queue manager that associates the userid of the original registration message with the subscriber's identity and from then on prevents any other user using that identity. If a new subscriber tries to use the same identity, the command fails with return code MQRCCF_DUPLICATE_SUBSCRIPTION.

      This allows any user to modify or deregister the subscription when they have suitable authority. Therefore, there is no need to check that the userid matches that of the original subscriber.

      To add this option to an existing subscription, the command must come from the same userid as the original subscription.

      If the subscription of the Request Update command has VariableUserId set, this must be set at request update time to indicate which subscription is referred to. Otherwise, the userid of the Request Update command is used to identify the subscription. This is overridden, along with the other subscriber identifiers, if a subscription name is supplied.

    The default, if this property is omitted, is that no registration options are set.

    QMgrName (MQPSC_Q_MGR_NAME)
    The value is the name of the queue manager for the subscriber queue, to which the matching retained publication is sent by the queue manager.

    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 queue manager's QMgrName.

    QName (MQPSC_Q_NAME)
    The value is the name of the subscriber queue, to which the matching retained publication is sent by the queue manager.

    If this property is omitted, the default is the ReplyToQ name in the message descriptor (MQMD), which must not be blank in this case.

    SubName (MQPSC_SUBSCRIPTION_NAME)
    This is a name given to a particular subscription. If specified on a Request Update command the SubName value takes precedence over all other identifier fields except the userid, unless VariableUserId is set on the subscription itself. If VariableUserId is not set, the Request Update command succeeds only if the userid of the command message matches that of the subscription. If the userid of the command message does not match that of the subscription, the command fails with return code MQRCCF_DUPLICATE_IDENTITY.

    If VariableUserId is set, and the userid differs from that of the subscription, the command succeeds if the userid of the new command message has authority to browse the stream queue and put to the subscriber queue of the subscription. Otherwise, the command fails with return code MQRCCF_NOT_AUTHORIZED.

    If a subscription exists that matches the traditional identity of this command, but has no SubName, the Request Update command fails with return code MQRCCF_SUB_NAME_ERROR.

    If an attempt is made to request an update for a subscription that has a SubName using a command message that matches the traditional identity, but with no SubName specified, the command succeeds.


Example

Here is an example of NameValueData for a Request Update command message. In the sample application, the results service uses this message to request retained publications containing the latest scores for all teams. The subscriber's identity, including the CorrelId, is taken from the defaults in the MQMD.
 <psc>
   <Command>ReqUpdate</Command>
   <RegOpt>CorrelAsId</RegOpt>
   <Topic>Sport/Soccer/State/LatestScore/#</Topic>
 </psc>