Retrieving Amazon SQS Messages from a Production
An InterSystems IRIS interoperability production can be an SQS consumer. You have two options: use a built-in business service or build your own business service that uses the SQS 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 messages from Amazon SQS without needing to write custom code. To use this business service:
-
Add EnsLib.AmazonSQS.ServiceOpens in a new tab to your production. See Adding Business Hosts.
-
Configure settings of this business host as described in Amazon SQS Settings.
The business service periodically polls for new messages. For each new message, the business service creates a message of type EnsLib.AmazonSQS.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 Amazon SQS Message Class.
Using the Adapter
If the built-in business service does not meet your needs, you can directly use the SQS 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.AmazonSQS.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 Amazon SQS Settings.
See Also
-
Using the Amazon SQS Messaging API (for use without a production)