Subscriptions and topics

Events are published to provide notification of changes to the subscription tables, changes in the list of defined topics or their access control lists.

Registration or deregistration of subscriptions causes events to be published using the following system topics:
$SYS/Broker/broker_name/Subscription/topic
where:
broker_name
is the name of the broker issuing this message.
topic
is the original topic on which the subscription is being, or was, registered.

The body of each publication is an XML message giving additional information concerning the registration or deregistration request.

These events are nonpersistent, non-retained publications.

Examples

Here are example event messages for a subscription being created, changed, and deleted.

Subscription created

Event publication topic = "$SYS/Broker/Broker1/Subscription/stock/IBM"

<Broker uuid="1234" label="Broker1" version="1">
  <ControlGroup>
    <DynamicSubscriptionEngine>
      <Topic name="stock/IBM">
        <Create>
          <Subscription
            clientId="mqrfh2:Broker1:client1queue"
            subscriptionPoint="poundsSterling"
            filter="currentPrice>100"
            user="Fred"
            persistent="true"
            localOnly="false"
            pubOnReqOnly="false"
            informIfRet="true"
            expiryTimeStamp="2000-12-31 23:59:59"
            createTimeStamp="2000-01-01 00:00:00"
            tempDynamicQueue="false"
            clientContext="hex digits"/>
        </Create>
      </Topic>
    </DynamicSubscriptionEngine>
  </ControlGroup>
</Broker>

Subscription changed

Event publication topic = "$SYS/Broker/Broker1/Subscription/stock/IBM"

<Broker uuid="1234" label="Broker1" version="1">
  <ControlGroup>
    <DynamicSubscriptionEngine>
      <Topic name="stock/IBM">
        <Change>
          <Subscription
            clientId="mqrfh2:Broker1:client1queue"
            subscriptionPoint="poundsSterling"
            filter="currentPrice>100"
            user="Fred"
            persistent="false"
            localOnly="true"
            pubOnReqOnly="true"
            informIfRet="false"
            expiryTimeStamp="2005-12-31 23:59:59"
            createTimeStamp="2000-01-01 00:00:00"
            tempDynamicQueue="false"
            clientContext="hex digits"/>
        </Change>
      </Topic>
    </DynamicSubscriptionEngine>
  </ControlGroup>
</Broker>

Subscription deleted (deregistered)

Event publication topic = "$SYS/Broker/Broker1/Subscription/stock/IBM"

<Broker uuid="1234" label="Broker1" version="1">
  <ControlGroup>
    <DynamicSubscriptionEngine>
      <Topic name="stock/IBM">
        <Delete>
          <Subscription
            clientId="mqrfh2:Broker1:client1queue"
            subscriptionPoint="poundsSterling"
            filter="currentPrice>100"
            user="Fred"/>
        </Delete>
      </Topic>
    </DynamicSubscriptionEngine>
  </ControlGroup>
</Broker>
Related concepts
Broker domain
Related tasks
Creating a broker