cAWSSQS
(SQS). The AWS SQS FIFO Feature for Queues are supported.
cAWSSQS Standard properties
These properties are used to configure cAWSSQS running in the Standard Job framework.
The Standard cAWSSQS component belongs to the AWS and Connectivity families.
Basic settings
Connection |
Select an AWS connection component from the list to reuse the |
Queue Name |
Enter the name of the queue to send message to or receive message |
The following options are available only when the cAWSSQS is used as a Producer: |
 |
Delay (in seconds) |
Specify the amount of time to delay the first delivery of all |
Wait Time (0 to 20 seconds) |
Specify the maximum amount of time in seconds (0 to 20) that a |
The following options are available only when the cAWSSQS is used as a Consumer: |
 |
Delete Message / After Read (processed by |
Select this check box to delete the message from the queue after |
Delete Message / If Filtered (matched by |
Select this check box to delete the messages from the queue that |
Allow Multiple Threads |
Select this check box to allow multiple threads to poll the SQS |
Extend Message Visibility |
Select this check box to enable a scheduled background task to |
Request Attribute / All |
Select this check box to retrieve the standard Amazon SQS |
Request Attribute / Approximate First Receive |
Select this check box to retrieve the |
Request Attribute / Approximate Receive |
Select this check box to retrieve the |
Request Attribute / Sender ID |
Select this check box to retrieve the |
Request Attribute / Sent Timestamp |
Select this check box to retrieve the |
Advanced settings
AWS Account ID (Queue Owner) |
Specify the queue owner’s AWS account ID when you need to connect |
Queue Configuration / Attributes |
Set the optional queue attributes in the
corresponding table. Click [+] as many times as required to add attributes to the table. Then click the corresponding Value field and enter a value. The following attributes are available:
|
Request Message Attribute |
This option is only available when cAWSSQS is used as a Consumer. Select this check box |
Usage
Usage rule |
cAWSSQS can be a start, middle or |
Limitation |
 n/a |
Sending messages to and receiving messages from Amazon’s SQS queue
This scenario applies only to Talend Open Studio for ESB, Talend Data Services Platform and Talend Data Fabric.
This scenario will show you how to use the cAWSSQS
component to send messages to and consume messages from an SQS queue. To do this, two
Routes are built, a message producer Route, and a consumer Route. Messages are sent to
the SQS queue in the producer Route and then consumed in the consumer Route.
You must have a valid Amazon Web Services developer account, and be signed up to use
Amazon SQS. For more information, see Amazon SQS.
Building the producer Route
Dropping and linking the components
-
From the Palette, drag and drop a cAWSConnection, two cTimer,
two cSetBody, two cAWSSQS components onto the design workspace. -
Label the components for better identification of their roles and link
them with the Row > Route connection as shown above.
Configuring the components
-
Double-click the cAWSConnection component to display its
Basic settings view in the Component tab. -
In the Access Key and Secret Key fields, enter the authentication
credentials of your AWS account. For how to get your Access Key and Access
Secret, see Access keys (access key ID
and secret access key). -
Double-click the cTimer labelled
repeat=2 to open its Basic
settings view in the Component tab. -
In the Repeat field, enter
2
to generate
the message exchange twice. Keep the default settings of the other
options. -
Configure the cTimer labelled
repeat=3 in the same way to generate the message
exchange three times. -
Double-click the cSetBody component labelled
body=hello to open its Basic
settings view in the Component tab. -
Select CONSTANT from the Language list and type in hello in the
Expression field as the message
body. -
Configure the cSetBody labelled
body=world in the same way to set the message body
as world. -
Double-click the cAWSSQS labelled
Producer_1 to open its Basic
settings view in the Component tab. -
In the Connection list, select the
cAWSConnection component that you have
just configured to connect to Amazon’s SQS service.In the Queue Name field, type in the name of the SQS
queue to send the messages. -
Configure the cAWSSQS labelled
Producer_2 with the same properties to send the
messages to the same queue. - Press Ctrl+S to save your Route.
Viewing the code and executing the Route
-
Click the Code tab at the bottom of the
design workspace to check the generated code.As shown above, in the first sub-route, the message flow from
sqsproducer_cTimer_1
is given a payload by
sqsproducer_cSetBody_1
and then sent to
sqsproducer_cAWSSQS_1
. The second sub-route is in the same
way. -
Press F6 to execute the Route. The logs of the message
exchange are printed in the console. The warn message shows that header
fireTime
is not put into the message attribute. -
In the SQS Web Console, you can see that there are now 5 messages in the queue
talend-com-tesb-camel-sqs.
Building the consumer Route
Arranging the flow of the message
-
From the Palette, drag and drop a
cAWSConnection, a cAWSSQS, a cMessageFilter
and a cLog component onto the design
workspace. -
Link the cAWSSQS to cMessageFilter with the Row
> Route connection and cMessageFilter to cLog with the Row >
Filter connection. - Label the components for better identification of their roles.
Configuring how the message is processed
-
Configure the cAWSConnection using the
same properties as in the producer Route. -
Double-click the cAWSSQS component to display its
Basic settings view in the Component tab. -
In the Connection list, select the
cAWSConnection component to connect to
Amazon’s SQS service.In the Queue Name field, enter the name
of the queue to consume the message from.Select the Delete Message / After Read
check box and clear the If Filtered check
box to delete the messages that are read and keep those that are not
consumed. -
Double-click the cMessageFilter component
to display its Basic settings view in the
Component tab. -
Select Simple from the Language list and enter “${body} ==
‘hello'” in the Expression
field to sort out messages with hello as the message
body. -
Keep the default settings of the cLog component to
log the message exchanges. - Press Ctrl+S to save your Route.
Executing the Route
-
Click the Code tab at the bottom of the
design workspace to check the generated code.As shown above, the message flow fromsqsconsumer_cAWSSQS_3
, is filtered by
sqsconsumer_cMessageFilter_1
, and then routed to
sqsconsumer_cLog_1
. -
Press F6 to execute the Route. The messages with the
bodyhello
are consumed and are printed in the console. -
In the SQS Web Console, you can see that there are now 3 three messages left in the queue
talend-com-tesb-camel-sqs
.
The two messages with the bodyhello
have been consumed and
deleted as configured in the cAWSSQS
component.