Use a Topic to Subscribe to a Message

This use case describes how to create an integration that uses the same topic (for this example, named TOPIN) used in the first integration to subscribe to a message that was published from that integration. Once the message has been subscribed, the same message is consumed and delivered to the outbound queue (for this example, named OUTQ).

  1. Configure the IBM MQ Series JMS Adapter on the Connections page. See Create a Connection.
  2. Create an application-driven integration. This is the second of two integrations that you create. The first is described in the first use case. See Put a Message in an Inbound Queue.
  3. Add the IBM MQ Series JMS Adapter as a trigger connection in the integration.
    The Adapter Endpoint Configuration Wizard is displayed.
  4. On the Basic Info page, Topic for the Destination Type value is selected.
  5. On the Configuration page, the following details are specified for this use case. Your selections can vary.
    • A topic of your choice for the Destination Name value (for this example, TOPIN is selected).
    • TextMessage for the Message Type value.
    • No for the Durable Subscriber value.
    • No value is set for the Message Selector value.
    • Yes for the Do you want to specify the structure for the payload value.
    • A schema of your choice for the Schema File value (for this example, singleString.xsd is selected).
  6. On the Headers page, JMSPriority and JMSType for the standard headers and department for the custom header are selected. These headers are sent to the outbound queue.
  7. Add the IBM MQ Series JMS Adapter as an invoke connection in the integration.
  8. On the Basic Info page, Queue for the Destination Type value is selected.
  9. On the Configuration page, the following details are specified for this use case:
    • OUTQ for the Destination Name value.
    • TextMessage for the Message Type value.
    • Persistent for the Delivery Mode value.
    • Priority=[0 - 9] for the Message Selector value.
    • Seconds for the Time to Live value.
    • Yes for the Do you want to specify the structure for the payload value.
    • A schema of your choice for the Schema File value (for this example, singleString.xsd is selected).
  10. On the Headers page, JMSPriority and JMSType for the standard headers and department for the custom header are selected. These headers are captured from the inbound topic and assigned to the outbound queue.
  11. In the mapper, the messages coming from the inbound topic are mapped to the outbound queue.
    • Source JMSType element is mapped to the target JMSType element.
    • Source JMSProperty department element is mapped to the target JMSProperty department element.
    • Target JMSPriority element is mapped to the target JMSPriority.
  12. Activate both integrations.
  13. Put an XML message in the inbound queue (INQ) to be consumed by this integration.
    In the first integration, the message is dequeued and published to the outbound topic (TOPIN).
    In the second integration, the TOPIN topic is subscribed to any message that arrives on it. TOPIN consumes the message and delivers it to the OUTQ queue.
  14. Check for the message and the headers such as JMSType and JMSPriority in the OUTQ queue.