Retrieve JMS Messages from within a Production
InterSystems IRIS becomes a JMS consumer when an interoperability production includes a business service that uses the JMS inbound adapter implemented using the PEX framework (EnsLib.JMSPEX). This adapter allows the business service to retrieve messages from a JMS queue or topic. You have two options when using a production as a JMS consumer: use a built-in business service that leverages the inbound adapter or build your own business service that uses the adapter.
This page describes how to use the inbound adapter and business service for JMS which InterSystems implements using the PEX framework. The associated classes are part of the EnsLib.JMSPEX package. Do not use classes from the legacy EnsLib.JMS package, which may be removed in future releases.
Built-in Business Service
Rather than building a custom business service that uses the inbound adapter, you can simply add EnsLib.JMSPEX.ServiceOpens in a new tab to the production and define the adapter properties using the Management Portal settings. As the business service retrieves messages from your JMS server at the interval determined by the Basic Settings > Call Interval setting, these messages are forwarded to another business host in the production using asynchronous requests. The business host where these requests are forwarded is determined by the Basic Settings > Target Config Names setting.
For basic information about adding a business service to a production, see Adding Business Hosts.
The JMS inbound adapter is the class EnsLib.JMSPEX.InboundAdapterOpens in a new tab. It includes the following settings, all of which appear in the Management Portal as settings for the business service that uses the adapter:
QueueOrTopicName defines the JMS queue or topic from which the consumer is receiving messages.
ReceiveSettings (optional) a JSON string defining settings for message retrieval. The list of available settings is the same as the list of properties made available by the JMS API JMSReceiveSettings class, with each property name serving as the key.
URL defines the URL for the JMS server.
InitialContextFactoryName defines the name of the initial JMS context factory.
ConnectionFactoryName defines the name of the JMS connection factory.
ClientID defines a string to identify the production as a JMS client.
Credentials defines the InterSystems credentials that correspond to the username and password of a JMS client. For details on creating credentials, see Defining Reusable Items for Use in Settings.
For general information about building a custom business service that uses an inbound adapter, see Defining Business Services.