Sending Messages to Amazon SQS from a Production
InterSystems IRIS becomes an Amazon SQS producer when an interoperability production includes a business operation which uses the Amazon SQS outbound adapter. This adapter allows the business operation to send messages to an Amazon SQS queue. You have two options when using a production as a Amazon SQS producer: use a built-in business operation that leverages the outbound adapter or build your own business operation that uses the adapter.
Adapter Details
The Amazon SQS outbound adapter is the class EnsLib.AmazonSQS.OutboundAdapterOpens in a new tab.
For general information about building a custom business operation that uses an outbound adapter, see Defining Business Operations.
Send Amazon SQS Messages
The class of the messages sent by the outbound adapter to Amazon SQS is EnsLib.AmazonSQS.MessageOpens in a new tab. This class contains several properties for defining the message, including the following:
-
queue defines the Amazon SQS queue where the producer is sending messages.
-
body defines the content of the message
For full descriptions of the message identifiers this class makes available through message object properties, refer to the Amazon SQS documentationOpens in a new tab.
You can also use the messageAttributes property to specify custom metadata for your message. The messageAttributes property accepts a %ListOfObjects collection of %External.Messaging.SQSMessageAttribute objects. See the documentation for the Amazon SQS API for further guidance on creating SQS message attribute objects. For general information about the use of message attributes to attach custom metadata, refer to the Amazon SQS documentationOpens in a new tab.
The outbound adapter's SendMessage() method takes a EnsLib.AmazonSQS.MessageOpens in a new tab object as its sole argument, and sends that message to the Amazon SQS server. For example, a custom business operation could call the adapter’s method by including the following:
Do ..Adapter.SendMessage(pRequest)
Built-in Business Operation
Rather than building a custom business operation that uses the outbound adapter, you can simply add EnsLib.AmazonSQS.OperationOpens in a new tab to the production and define the necessary settings using the Management Portal. This business operation calls the adapter's SendMessage() method when it receives a request from another business host in the production. This request should contain an Amazon SQS message of type EnsLib.AmazonSQS.MessageOpens in a new tab.
For basic information about adding a business operation to a production, see Adding Business Hosts.
General AWS Settings
The SQS outbound adapter extends a common adapter class that includes general AWS properties. When you add a business operation that uses the outbound adapter to a production, these AWS properties can be set using the AWS settings for the business operation in the Management Portal.
-
CredentialsFile — If blank, Amazon uses the default credential provider chainOpens in a new tab to obtain the credentials needed to access SQS. If you prefer to use an AWS credential file, enter its pathname.
-
Region — Identifies the AWS region that you want to access. For a list of regions, see Amazon Regions, Availability Zones, and Local ZonesOpens in a new tab.
See Also
-
Using the Amazon SQS Messaging API (for use without a production)