Retrieving RabbitMQ Messages from a Production
An InterSystems IRIS interoperability production can be a RabbitMQ consumer. You have two options: use a built-in business service or build your own business service that uses the RabbitMQ inbound adapter. There is also an API for use outside of a production.
Using the Business Service
InterSystems provides a built-in business service that can be used to retrieve RabbitMQ messages without needing to write custom code. To use this business service:
-
Add EnsLib.RabbitMQ.ServiceOpens in a new tab to your production. See Adding Business Hosts.
-
Configure settings of this business host as described in RabbitMQ Settings.
The business service periodically polls the configured RabbitMQ queue for new messages. For each new message, the business service creates a message of type EnsLib.RabbitMQ.MessageOpens in a new tab and populates that with the message contents, and then forwards the message to the configured targets within the production using asynchronous requests.
For details on this message class, see RabbitMQ Message Class.
Using the Adapter
If the built-in business service does not meet your needs, you can directly use the RabbitMQ inbound adapter as follows:
-
Create a custom business service class:
-
Your business service class should extend Ens.BusinessServiceOpens in a new tab.
-
In your class, the ADAPTER parameter should equal EnsLib.RabbitMQ.InboundAdapterOpens in a new tab.
-
Your class should implement the OnProcessInput() method:
Method OnProcessInput(pInput As %Net.Remote.Object, Output pOutput As %RegisteredObject) As %Status { }
-
-
Add your business service to your production. See Adding Business Hosts.
-
Configure settings of this business host as described in RabbitMQ Settings.
See Also
-
Using the RabbitMQ Messaging API (for use without a production)