////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////
:documentationPath: /pipeline/transforms/
:language: en_US
:description: The AWS SQS Reader transform enables you to receive messages from Amazon Web Services Simple Queue Service within an Apache Hop pipeline.

= image:transforms/icons/aws-sqs.svg[AWS SQS Reader, role="image-doc-icon"] AWS SQS Reader

[%noheader,cols="3a,1a", role="table-no-borders" ]
|===
|
== Description

The AWS SQS Reader transform enables you to receive messages from Amazon Web Services Simple Queue Service within an Apache Hop pipeline.
|
== Supported Engines
[%noheader,cols="2,1a",frame=none, role="table-supported-engines"]
!===
!Hop Engine! image:check_mark.svg[Supported, 24]
!Spark! image:question_mark.svg[Supported, 24]
!Flink! image:question_mark.svg[Supported, 24]
!Dataflow! image:question_mark.svg[Supported, 24]
!===
|===

== Preconditions

Before the first execution you need to create an IAM-Role (e.g. for usage on EC2/ECS) or an IAM-User with an AWS Key and Secret and attach the required policies for pushing notifications via SNS.

You also need to create one ore more subscription topics you want to push the messages to.

== Options

=== AWS Settings tab

[options="header", width="90%"]
|===
|option|description
|Use AWS Credentials chain|Apache Hop tries to pick up the AWS credentials from the host environment. For more information, check the https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html[Credentials] docs.
|AWS Access Key|your AWS Access Key (`AWS_ACCESS_KEY_ID`)
|AWS Secret Access Key|the secret for your AWS Access Key (`AWS_SECRET_ACCESS_KEY`)
|AWS Region|the AWS-Region the service is running in.
|SQS Queueu URL|the URL of the SQS Queue (starting with https:// - not the ARN!)
|===

=== Output definition

On the Output Definition Tab you can define the output fields for the informations read from the SQS message as well as some initial settings for receiving the messages.

==== Output Settings

[options="header", width="90%"]
|===
|Option|Description
|Delete Message(s)|delete the message(s) be from the queue after receiving?
|Maximum messages to retrieve|finish after reaching this maximum number of messages. Zero (0) will receive all messages in the queue.
|===

==== Output Settings

[options="header", width="90%"]
|===
|Option|Description
|MessageID|For each message an unique ID is retrieved from SQS. This can be written to an output field defined here.
|MessageBody|Complete content of the message.
|ReceiptHandle|Unique identifier for receiving a message.
|MD5 Hash|MD5 hash of the message body
|Message Node from SNS|if the message was sent from SNS this field will contain the content of the JSON node "Message" within the Message body.
|===