Publish/subscribe using the IBM MQ bridge for HTTP

IBM MQ bridge for HTTP uses the IBM MQ classes for JMS publish/subscribe interface. HTTP POST creates a publication. HTTP DELETE creates a non-durable managed subscription. You must configure publish/subscribe for JMS before using the topic URI.

Publish/subscribe is fully integrated into IBM MQ in version 7. Before version 7, a separate publish/subscribe broker handled publications and subscriptions. It is called queued publish/subscribe, to distinguish it from the fully integrated publish/subscribe in version 7. Version 7 emulates queued publish subscribe using integrated publish/subscribe. The emulation enables existing queued publish/subscribe applications to coexist with integrated applications running on the same queue manager. Queued publish/subscribe applications can also interoperate with integrated applications, sharing the same topics. In Version 6, the broker was shipped with IBM MQ; before Version 6 it was available as a SupportPack.


Configuration

The IBM MQ bridge for HTTP uses the JMS interface to publish and subscribe. In version 7, we can control whether the IBM MQ classes for JMS use queued or integrated publish/subscribe, using the PROVIDERVERSION JMS property.

An additional consideration is that we can use either IBM MQ MQI client libraries with IBM MQ bridge for HTTP, or server libraries. Version 6 client libraries only support queued publish/subscribe, whereas version 7 libraries support both queued and integrated publish/subscribe. Most Web or application servers that use IBM MQ as a messaging provider do so using client libraries. In order to use integrated publish/subscribe, both the IBM MQ MQI client and server libraries must be at least at version 7. If either is running an earlier version of WebSphere than 7, then you must configure queued publish/subscribe; see Table 1. Check what libraries are installed or configured with the Web server or application server you are using.

Table 1. Publish/subscribe configuration modes
  Client V6 or earlier Client V7 or later
Server V6 or earlier
  1. Run the \java\bin\MQJMS_PSQ.mqsc script
Not supported
Server V7 or later
  1. Run the \java\bin\MQJMS_PSQ.mqsc script
  2. Set the queue manager to PSMODE=ENABLED
  1. If PROVIDERVERSION = 7
    1. Set the queue manager to PSMODE=ENABLED or PSMODE=COMPAT
  2. If PROVIDERVERSION = 6
    1. Set the queue manager to PSMODE=ENABLED


Publish

Send an HTTP POST request with the URI:
http://hostname: port/context_root/msg/topic/topicString
The message contents are published using the topic string topicString.


Subscribe

Send an HTTP DELETE request with the URI:
http://hostname: port/context_root/msg/topic/topicString
IBM MQ bridge for HTTP creates a managed non-durable subscription to the topic string topicString. The subscription is deleted as soon as a publication is returned, or until the wait-interval set by the custom entity-header, x-msg-wait, expires.