SQSReceiver microservice is used to retrieve messages from Amazon Simple Queue Service (SQS).

Configuration and Testing

Component Configurations

The following attributes can be configured in the Interaction Configuration panel as shown below.


Figure 1: Component Configuration Properties

Pre Processing XSL Configuration

Pre Processing XSL configuration can be used to transform request message before processing it. Click the small button against the property to configure the properties.

Icon

Refer to the Pre/Post Processing XSL Configuration section under Common Configurations topic for details regarding XSL configuration. The properties comprising this XSL configuration are:

  • Provide XSL
  • XSLT Engine
  • Transformation source data
  • Set transformation result as

Post Processing XSL Configuration

Post Processing XSL configuration can be used to transform response message before sending it to the output port.

Icon

As mentioned in the above section, refer to the Pre/Post Processing XSL Configuration section under the Common Configurations topic for details regarding XSL configuration.

Process Message Based on Property

The property helps components to skip certain messages from processing.

Icon

Refer the Process Message Based On a Property section under the Common Configurations topic.

Validate Input

If this attribute is enabled, the service tries to validate the input received. If disabled, service will not validate the input. For more details, refer Validate Input section section under Interaction Configurations in Common Configurations page.

Icon

Performance increases Validate Input option is disabled, but it may cause undesired results in case the input XML is not valid.

Error handling configuration

The remedial actions to be taken when a particular error occurs can be configured using this attribute. 

Click the ellipsis button against this property to configure Error Handling properties for different types of Errors. By default, the options Log to error logs, Stop service and Send to error port are enabled.

Refer Error Handling section in Common Configurations for detailed information.

AWS Connection Details

Click the AWS Connection Details ellipsis  button to configure the properties.


Figure 2: AWS Connection properties

Access key 

Specify the Access Key id

Secret key

Specify the Secret Key

Region

The region of AWS Management console.

Queue Name

Name of the queue from which messages are to be obtained.

Delete Messages

Received messages are deleted from queue if enabled.

Attribute Names

Attributes to add to input scheme for easy mapping.


Figure 3: Option to provide attribute names

Icon

Amazon SQS can delete your queue without notification if none of the following actions have been performed on it for 30 consecutive days: SendMessage, ReceiveMessage, DeleteMessage, GetQueueAttributes, SetQueueAttributes, AddPermission, and RemovePermission

Threadpool Configuration

This property is used when there is a need to process messages in parallel within the component, still maintaining the sequence from the external perspective. 

Icon
  • This needs to be used only in such circumstances.
  • If sequential processing is not required, please use sessions on the input port.

Click the Threadpool Configuration ellipsis button to configure the Threadpool Configuration properties. 


Figure 4: Threadpool Configuration properties

Enable Thread Pool

Enable this option to configure the properties that appear as below.

Pool Size

Number of requests to be processed in parallel within the component. Default value is '1'.

Batch Eviction Interval (in ms)

Time in milliseconds after which the threads are evicted in case of inactivity. New threads are created in place of evicted threads when new requests are received. Default value is '1000'.

Functional Demonstration

The following flow demonstrates a flow of SQS Receiver receiving data from the configured Queue


Figure 5: Sample flow demonstrating SQS Receiver functionality

Input Request

The Input  message consists of following elements

MaximumNumberOfMessages

The maximum number of messages to return. Amazon SQS never returns more messages than this value but may return fewer  .    

WaitTimeSeconds

The duration (in seconds) for which the call will wait for a message to arrive in the queue before returning. If a message is available,the call will return sooner than WaitTimeSecond     .

VisibilityTimeoutSeconds

The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a request. 

Icon

If these properties are not provided, the default properties associated with the configured Queue shall be taken into account.


Figure 6: Sample input request sent using the Feeder microservice

Output Message

The output message consists of following elements

MessageIdentifier

A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time

MessageBody

Message's  body

ReceiptHandle

An identifier associated with the act of receiving the message. A new receipt handle is returned every time a message is received. When deleting a message, provide the last received receipt handle to delete the message

MD5Body

An MD5 digest of the non-URL-encoded message body string. This can be used to verify that Amazon SQS received the message correctly.

MD5Attributes

An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly.

SenderID

Unique ID of the Sender who passed the message to the queue.

ApproximateReceiveCount

Returns the number of times a message has been received from the queue but not deleted.

SentTimestamp

Time Stamp, when the message was received by the queue.

ApproximateFirstReceiveTimestamp

Returns the time the message was first received from the queue (time in milliseconds).

MessageAttribute

  • Name: Name of the message obtained from  the queue.
  • DataType: DataType of the message received.
  • Value: Value associated with the data type.

Output Message Structure:


Figure 7: Output message received in the Display microservice

Adaptavist ThemeBuilder EngineAtlassian Confluence