Skip to main content

Retrieving RabbitMQ Messages from within a Production

InterSystems IRIS becomes a RabbitMQ consumer when an interoperability production includes a business service that uses the RabbitMQ inbound adapter. This adapter allows the business service to retrieve messages from a RabbitMQ queue. You have two options when using a production as a RabbitMQ consumer: use a built-in business service that leverages the inbound adapter or build your own business service that uses the adapter.

Built-in Business Service

Rather than building a custom business service that uses the inbound adapter, you can simply add EnsLib.RabbitMQ.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 RabbitMQ 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.

Adapter Details

The RabbitMQ inbound adapter is the class EnsLib.RabbitMQ.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:

  • Queue Name defines the RabbitMQ queue from which the consumer is receiving messages.

  • ExchangeName (optional) defines the RabbitMQ exchange which routes messages to the queue.

    Note:

    For more information about how RabbitMQ routes messages, refer to the RabbitMQ documentationOpens in a new tab.

  • BindingKeys (optional) defines the keys which bind the queue your production is receiving messages from to the exchange you named.

  • 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 RabbitMQ API RabbitMQReceiveSettings class, with each property name serving as the key.

  • MQHost defines the hostname or IP address for the RabbitMQ server.

  • MQPort defines the port number for communicating with RabbitMQ.

  • MQVirtualHost (optional) defines the virtual hostname for RabbitMQ.

  • Credentials defines the InterSystems credentials that correspond to the username and password of a RabbitMQ 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.

SSL/TLS Configuration

Both of the RabbitMQ adapters (inbound and outbound) accept additional settings which allow you to configure your production to connect with RabbitMQ using SSL/TLS. These settings also appear in the Management Portal as settings for the business service that uses the adapter.

For a detailed list of these settings, refer to the instructions for configuring a RabbitMQ client using the RabbitMQ API.

See Also

FeedbackOpens in a new tab