AmazonSQS Inbound Endpoint Reference¶
The following configurations allow you to configure AmazonSQS Inbound Endpoint for your scenario.
Note
If your server is running on an EC2 instance, you can use IAM role for authentication with Amazon SQS Inbound Endpoint v1.1.0 and above. Please note that both the secretKey
and accessKey
parameters should be excluded when using IAM Role authentication.
Parameter | Description | Required | Possible Values | Default Value |
---|---|---|---|---|
waitTime |
The time to wait when polling queues for messages. By default, there is no wait (short polling). Setting the waitTime up to 20 seconds (the maximum wait time) creates long polling. | No | 0 - 20 |
0 |
destination |
URL of the Amazon SQS Queue from which you want to consume messages. | Yes | N/A | N/A |
secretKey |
The secret key used to sign requests (a 40-character sequence). | Yes, if IAM Role authentication is not used. | N/A | N/A |
accessKey |
The access key that corresponds to the secret key that you used to sign the request (a 20-character sequence). | Yes, if IAM Role authentication is not used. | N/A | N/A |
maxNoOfMessage |
Maximum number of messages to return. Amazon SQS never returns more messages than this value but might return fewer. Not necessarily all the messages in the queue are returned. | No | 1-10 |
1 |
attributeNames |
A comma-separated list of attributes you want to return along with the received message. | No | N/A | N/A |
contentType |
Content type of the message | No | text/plain |
text/plain |
autoRemoveMessage |
Check whether the message needs to be deleted from the queue. If you set this parameter to false, the message will remain in the queue until the message retention period expires. | No | true |
true |
Rollback the messages
In a failure scenario, the Amazon SQS message will roll back if the following property is set to true in the fault sequence.
<property name="SET_ROLLBACK_ONLY" value="true"/>
Sample fault sequence
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="fault" xmlns="http://ws.apache.org/ns/synapse">
<property name="SET_ROLLBACK_ONLY" value="true"/>
<log level="custom">
<property name="Transaction Action" value="Rollbacked"/>
</log>
<log level="full">
<property name="MESSAGE" value="Executing default 'fault' sequence"/>
<property expression="get-property('ERROR_CODE')"
name="ERROR_CODE" xmlns:ns="http://org.apache.synapse/xsd"/>
<property expression="get-property('ERROR_MESSAGE')"
name="ERROR_MESSAGE" xmlns:ns="http://org.apache.synapse/xsd"/>
</log>
<drop/>
</sequence>