<a id="cc-amazon-sqs-source"></a>

# Amazon SQS Source Connector for Confluent Cloud

The fully managed Amazon Simple Queue Service (SQS) Source connector for
Confluent Cloud is used to move messages from an Amazon SQS Queue into Apache Kafka®. It
supports both [Standard queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html)
and [First-In-First-Out (FIFO) queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html).
The connector polls an Amazon SQS queue, converts SQS messages into Kafka
records, and then pushes the records into a Kafka topic.

#### NOTE
* This Quick Start is for the fully managed Confluent Cloud connector. If you are
  installing the connector locally for Confluent Platform, see [Amazon SQS
  Source Connector for Confluent Platform](https://docs.confluent.io/kafka-connectors/sqs/current/).
* If you require private networking for fully managed connectors, make sure to set up the proper
  networking beforehand. For more information, see [Manage Networking for Confluent Cloud Connectors](networking/internet-resource.md#clusters-connect-cloud).

The connector converts an Amazon SQS message into a Kafka record, with the
following structure:

* The key encodes the SQS queue name and message ID in a struct. For FIFO queues, it also includes the message group ID.
* The value encodes the body of the SQS message and various message attributes in a struct.
* Each header encodes message attributes that may be present in the SQS message.

For record schema details, see [Record Schemas](#cc-amazon-sqs-record-schemas).

For **standard queues**, the connector supports best-effort ordering guarantees.
This means that there is a chance records will end up in a different order in
Kafka.

For **FIFO queues**, the connector guarantees records are inserted into Kafka in
the order they were inserted in Amazon SQS, as long as the destination Kafka
topic has exactly one partition. If the destination topic has more than one
partition, you can use a [Single Message Transformation](single-message-transforms.md#cc-single-message-transforms) to set the partition based on the MessageGroupId
field in the key.

Note that the connector provides **least once delivery**. This means there is a
chance that the connector can introduce duplicate records in Kafka for both
standard and FIFO queues.

## Features

The Amazon SQS Source connector provides the following features:

* **Topics created automatically**: The connector can automatically create Kafka topics.
* **At least once delivery**: The connector guarantees that records are delivered at least once to the Kafka topic.
* **Supports multiple tasks**: The connector supports running one or more tasks. More tasks may improve performance.
* **Automatic retries**: The connector will retry all requests (that can be retried) when the Amazon SQS service is unavailable. This value defaults to three retries.
* **Supported data formats**: The connector supports Avro, JSON Schema (JSON-SR), Protobuf, and JSON (schemaless) output formats. [Schema Registry](../get-started/schema-registry.md#cloud-sr-config) must be enabled to use a Schema Registry-based format (for example, Avro, JSON Schema, or Protobuf).
* **Provider integration support**: The connector supports IAM role-based authorization using Confluent Provider Integration.
  For more information about provider integration setup, see the [IAM roles authentication](#cc-amazon-sqs-source-setup-connection).

For more information and examples to use with the Confluent Cloud API for Connect,
see the [Confluent Cloud API for Connect Usage Examples](connect-api-section.md#ccloud-connect-api) section.

## Limitations

Be sure to review the following information.

* For connector limitations, see [Amazon SQS Source Connector](limits.md#cc-amazon-sqs-source-limits) limitations.
* If you plan to use one or more Single Message Transformations (SMTs), see [SMT Limitations](single-message-transforms.md#cc-single-message-transforms-limitations).

## Quick Start

Use this quick start to get up and running with the Confluent Cloud Amazon SQS Source
connector. The quick start provides the basics of selecting the connector and
configuring it to stream events.

<a id="cc-amazon-sqs-source-prereqs"></a>

Prerequisites
: - Authorized access to a [Confluent Cloud](https://www.confluent.io/confluent-cloud/) cluster on Amazon Web Services (AWS), Microsoft Azure (Azure), or Google Cloud.
  - The Confluent CLI installed and configured for the cluster. See [Install the Confluent CLI](https://docs.confluent.io/confluent-cli/current/install.html).
  - For networking considerations, see [Manage Networking on Confluent Cloud](../networking/overview.md#cloud-networking). To use a set of public egress IP addresses, see [Public Egress IP Addresses for Confluent Cloud Connectors](static-egress-ip.md#cc-static-egress-ips).
  - An AWS account configured with [Access Keys](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys). You use these access keys when setting up the connector.
  - Amazon SQS connection details. For more information, see [Setting up Amazon SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-setting-up.html).

### Using the Confluent Cloud Console

#### Step 1: Launch your Confluent Cloud cluster

To create and launch a Kafka cluster in Confluent Cloud, see [Create a kafka cluster in Confluent Cloud](../get-started/index.md#cloud-create-kafka-cluster).

#### Step 2: Add a connector

In the left navigation menu, click **Connectors**. If you already have connectors in your cluster, click **+ Add
connector**.

#### Step 3: Select your connector

Click the **Amazon SQS Source** connector card.

![Amazon SQS Source Connector Card](images/ccloud-amazon-sqs-source-icon.png)

<a id="cc-amazon-sqs-source-setup-connection"></a>

#### Step 4: Enter the connector details

#### NOTE
* Make sure you have all your [prerequisites](#cc-amazon-sqs-source-prereqs) completed.
* An asterisk ( \* ) designates a required entry.

At the **Add Amazon SQS Source Connector** screen, complete the following:

### Topic selection

Select the topic you want to send data to from the **Topics** list. To
create a new topic, click **+Add new topic**.

### Kafka access

1. Select the way you want to provide **Kafka Cluster credentials**. You can
   choose one of the following options:
   - **My account**: This setting allows your connector to globally access everything
     that you have access to. With a user account, the connector uses an API key and
     secret to access the Kafka cluster. This option is not recommended for production.
   - **Service account**: This setting limits the access for your connector by using a
     [service account](service-account.md#s3-cloud-service-account). This option is recommended for
     production.
   - **Use an existing API key**: This setting allows you to specify an API key and a
     secret pair. You can use an existing pair or create a new one. This method is not
     recommended for production environments.

   #### NOTE
   Freight clusters support only service accounts for Kafka authentication.
2. Click **Continue**.

### Authentication

1. Configure the authentication properties:

   **AWS credentials**
   - **Authentication method**: Under **AWS credentials**, select how you want to authenticate with AWS:
     - If you select **Access Keys**, enter your AWS credentials in the **Amazon Access Key ID**
       and **Amazon Secret Access Key** fields to connect to Amazon SQS. For information about how
       to set these up, see [Access Keys](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys).
     - If you select **IAM Roles**, choose an existing integration name under **Provider integration name** dropdown that has access to your resource. For more information, see [Manage Provider Integration for Fully Managed Connectors in Confluent Cloud](provider-integration.md#cloud-pi-quickstart).
   - **Provider Integration**: Select an existing integration that has access to your resource if you select **IAM Roles** as your authentication method.
   - **AWS Access Key**: Specify the Amazon Access Key that lets the connector access your SQS resource if you select **Access Keys** as your authentication method.
   - **AWS Secret Key**: Specify the Amazon Secret Key that lets the connector access your SQS resource if you select **Access Keys** as your authentication method.

   **How should we connect to Amazon SQS?**
   - **Fully qualified SQS URL**: Fully qualified Amazon SQS URL to read
     messages from. For example,
     `https://sqs.us-east-2.amazonaws.com/123456789012/MyQueue`. For
     details, see [Amazon SQS queue and message identifiers](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html).
   - **SQS Region**: The AWS region that the SQS queue belongs to. If left
     empty, the connector attempts to infer the region from the SQS URL.
2. Click **Continue**.

### Configuration

**Output messages**

- **Select output record value format**: Select the output record value format (Data going to the Kafka topic).
  Valid entries are AVRO, JSON_SR (JSON Schema), PROTOBUF, or JSON. [Schema Registry](../get-started/schema-registry.md#cloud-sr-config) must be enabled to use a Schema Registry-based format (for
  example, Avro, JSON Schema, or Protobuf).

### **Show advanced configurations**

- **Schema context**: Select a schema context to use for this connector, if using
  a schema-based data format. This property defaults to the **Default** context,
  which configures the connector to use the default schema set up for Schema Registry in your
  Confluent Cloud environment. A schema context allows you to use separate schemas (like
  schema sub-registries) tied to topics in different Kafka clusters that share the
  same Schema Registry environment. For example, if you select a non-default context, a
  **Source** connector uses only that schema context to register a schema and a
  **Sink** connector uses only that schema context to read from. For more
  information about setting up a schema context, see [What are schema contexts and when should you use them?](../sr/faqs-cc.md#faq-schema-contexts).
- **Enable Schemas for records in JsonConverter**: Include schemas within each of the serialized values.
- **Replace null with default in JsonConverter**: Whether to replace fields that have a default value and that are null to the default value. When set to true, the default value is used, otherwise null is used.
- **Whether to ignore the default for nullable fields when the value is null**: When set to true, this property ensures that the corresponding record in Kafka is NULL, instead of showing the default column value. Applicable only if you select the output record value format as `AVRO`, `JSON_SR`, or `PROTOBUF`.

**Auto-restart policy**

- **Enable Connector Auto-restart**: Enables the auto-restart behavior of the connector and its
  task in the event of user-actionable errors. Defaults to `true`, enabling the connector to
  automatically restart in case of user-actionable errors. Set this property to `false` to
  disable auto-restart for failed connectors. If disabled, you must manually restart the connector.

**Additional Configs**

- **Value Converter Decimal Format**: Specifies the `JSON` or `JSON_SR` serialization format for Connect `DECIMAL` logical type values with two allowed literals:
  `BASE64` to serialize `DECIMAL` logical types as base64 encoded binary data, and
  `NUMERIC` to serialize `DECIMAL` logical type values in `JSON` or `JSON_SR` as a number representing the decimal value.
- **Key Converter Schema ID Serializer**: The class name of the schema ID serializer for keys. This is used to serialize schema IDs in the message headers.
- **Value Converter Reference Subject Name Strategy**: Sets the subject reference name strategy for values. Valid entries are `DefaultReferenceSubjectNameStrategy` or `QualifiedReferenceSubjectNameStrategy`. You can use this strategy only with `PROTOBUF` format; the default strategy is `DefaultReferenceSubjectNameStrategy`.
- **Value Converter Connect Meta Data**: Enables the Connect converter to add its metadata to the output schema. Applies to Avro converters.
- **Value Converter Value Subject Name Strategy**: Determines how to construct the subject name under which the value schema is registered with Schema Registry.
- **Key Converter Key Subject Name Strategy**: Determines how to construct the subject name for key schema registration.
- **Value Converter Schema ID Serializer**: The class name of the schema ID serializer for values. This is used to serialize schema IDs in the message headers.

**Transforms**

- **Single Message Transformations**: To add a new SMT, see [Add transforms](single-message-transforms.md#cc-single-message-transforms-ui).
  For more information about unsupported SMTs, see
  [Unsupported transformations](single-message-transforms.md#cc-single-message-transforms-unsupported-transforms).

- Click **Continue**.

### Sizing

Based on the number of topic partitions you select, you will be provided
with a recommended number of tasks.

1. To change the number of tasks, use the Range Slider to select the
   desired number of tasks.
2. Click **Continue**.

### Review and Launch

1. Verify the connection details by previewing the running configuration.
2. Once you’ve validated that the properties are configured to your
   satisfaction, click **Launch**.

   The status for the connector should go from **Provisioning** to
   **Running**.

#### Step 5: Check for records

Verify that records are being produced at the Kafka topic.

For more information and examples to use with the Confluent Cloud API for Connect,
see the [Confluent Cloud API for Connect Usage Examples](connect-api-section.md#ccloud-connect-api) section.

### Using the Confluent CLI

Complete the following steps to set up and run the connector using the Confluent CLI.

#### NOTE
Make sure you have all your [prerequisites](#cc-amazon-sqs-source-prereqs) completed.

#### Step 1: List the available connectors

Enter the following command to list available connectors:

```none
confluent connect plugin list
```

#### Step 2: List the connector configuration properties

Enter the following command to show the connector configuration properties:

```none
confluent connect plugin describe <connector-plugin-name>
```

The command output shows the required and optional configuration properties.

#### Step 3: Create the connector configuration file

Create a JSON file that contains the connector configuration properties. The
following entry shows the required configuration properties.

```json
{
  "name": "SqsSource_0",
  "config": {
    "connector.class": "SqsSource",
    "name": "SqsSource_0",
    "kafka.auth.mode": "KAFKA_API_KEY",
    "kafka.api.key": "<my-kafka-api-key>",
    "kafka.api.secret": "<my-kafka-api-secret>",
    "sqs.url": "https://sqs.us-east-2.amazonaws.com/123456789012/MyQueue",
    "kafka.topic": "stocks",
    "aws.access.key.id": "<INSERT AWS API KEY>",
    "aws.secret.key.id": "<INSERT AWS API SECRET KEY ID>",
    "output.data.format": "JSON",
    "tasks.max": "1"
  }
}
```

Note the following property definitions:

* `"connector.class"`: Identifies the connector plugin name.
* `"name"`: Sets a name for your new connector.

* `"kafka.auth.mode"`: Identifies the connector authentication mode you want to use. There are two options: `SERVICE_ACCOUNT` or `KAFKA_API_KEY` (the default). To use an API key and secret, specify the configuration properties `kafka.api.key` and `kafka.api.secret`, as shown in the example configuration (above).  To use a [service account](service-account.md#s3-cloud-service-account), specify the **Resource ID** in the property `kafka.service.account.id=<service-account-resource-ID>`. To list the available service account resource IDs, use the following command:
  ```bash
  confluent iam service-account list
  ```

  For example:
  ```bash
  confluent iam service-account list

     Id     | Resource ID |       Name        |    Description
  +---------+-------------+-------------------+-------------------
     123456 | sa-l1r23m   | sa-1              | Service account 1
     789101 | sa-l4d56p   | sa-2              | Service account 2
  ```

* `"sqs.url"`: For example, `https://sqs.us-east-2.amazonaws.com/123456789012/MyQueue`. For details, see [Amazon SQS queue and message identifiers](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html).
* `"sqs.region"`: The AWS region that the SQS queue belongs to. If this property is not used, the connector attempts to infer the region from the SQS URL.
* `"aws.access.key.id"` and `"aws.secret.key.id"`: Enter the AWS Access Key ID and Secret Key ID. For information about how to set these up, see [Access Keys](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys).
* `"output.data.format"`: Enter an output data format (data going to the Kafka topic): AVRO, JSON_SR (JSON Schema), PROTOBUF, or JSON (schemaless). [Schema Registry](../get-started/schema-registry.md#cloud-sr-config) must be enabled to use a Schema Registry-based format (for example, Avro, JSON_SR (JSON Schema), or Protobuf).
* `"tasks.max"`: Enter the number of [tasks](/platform/current/connect/concepts.html#tasks) to use with the connector. More tasks may improve performance.

**SMTs**: For details about adding SMTs using the Confluent CLI, see the [Single Message Transformations](single-message-transforms.md#cc-single-message-transforms) documentation.

See [Configuration Properties](#cc-amazon-sqs-source-config-properties) for all property values and
descriptions.

#### Step 4: Load the properties file and create the connector

Enter the following command to load the configuration and start the connector:

```none
confluent connect cluster create --config-file <file-name>.json
```

For example:

```none
confluent connect cluster create --config-file sqs-source-config.json
```

Example output:

```none
Created connector SqsSource_0 lcc-do6vzd
```

#### Step 5: Check the connector status

Enter the following command to check the connector status:

```none
confluent connect cluster list
```

Example output:

```none
ID           |       Name       | Status  | Type   | Trace
+------------+------------------+---------+--------+-------+
lcc-do6vzd   | SqsSource_0      | RUNNING | source |       |
```

#### Step 6: Check for records.

Verify that records are being produced at the Kafka topic.

For more information and examples to use with the Confluent Cloud API for Connect,
see the [Confluent Cloud API for Connect Usage Examples](connect-api-section.md#ccloud-connect-api) section.

<a id="cc-amazon-sqs-source-config-properties"></a>

## Configuration Properties

Use the following configuration properties with the fully managed connector. For
self-managed connector property definitions and other details, see the connector
docs in [Self-managed connectors for Confluent Platform](/platform/current/connect/kafka_connectors.html).

### How should we connect to your data?

`name`
: Sets a name for your connector.
  <br/>
  * Type: string
  * Valid Values: A string at most 64 characters long
  * Importance: high

### Kafka Cluster credentials

`kafka.auth.mode`
: Kafka Authentication mode. It can be one of KAFKA_API_KEY or SERVICE_ACCOUNT. It defaults to KAFKA_API_KEY mode, whenever possible.
  <br/>
  * Type: string
  * Valid Values: SERVICE_ACCOUNT, KAFKA_API_KEY
  * Importance: high

`kafka.api.key`
: Kafka API Key. Required when kafka.auth.mode==KAFKA_API_KEY.
  <br/>
  * Type: password
  * Importance: high

`kafka.service.account.id`
: The Service Account that will be used to generate the API keys to communicate with Kafka Cluster.
  <br/>
  * Type: string
  * Importance: high

`kafka.api.secret`
: Secret associated with Kafka API key. Required when kafka.auth.mode==KAFKA_API_KEY.
  <br/>
  * Type: password
  * Importance: high

### Which topic do you want to send data to?

`kafka.topic`
: Identifies the topic name to write the data to.
  <br/>
  * Type: string
  * Importance: high

### Schema Config

`schema.context.name`
: Add a schema context name. A schema context represents an independent scope in Schema Registry. It is a separate sub-schema tied to topics in different Kafka clusters that share the same Schema Registry instance. If not used, the connector uses the default schema configured for Schema Registry in your Confluent Cloud environment.
  <br/>
  * Type: string
  * Default: default
  * Importance: medium

### AWS credentials

`authentication.method`
: Select how you want to authenticate with AWS.
  <br/>
  * Type: string
  * Default: Access Keys
  * Importance: high

`aws.access.key.id`
: The Amazon Access Key used to connect to SQS.
  <br/>
  * Type: password
  * Importance: high

`provider.integration.id`
: Select an existing integration that has access to your resource. In case you need to integrate a new IAM role, use provider integration
  <br/>
  * Type: string
  * Importance: high

`aws.secret.key.id`
: The Amazon Secret Key used to connect to SQS.
  <br/>
  * Type: password
  * Importance: high

### How should we connect to Amazon SQS?

`sqs.url`
: Fully qualified Amazon SQS URL to read messages from
  <br/>
  * Type: string
  * Importance: high

`sqs.region`
: The AWS region that the SQS queue belongs to. If left empty, the connector will attempt to infer the region from the SQS URL.
  <br/>
  * Type: string
  * Importance: medium

### Output messages

`output.data.format`
: Sets the output Kafka record value format. Valid entries are AVRO, JSON_SR, PROTOBUF, or JSON. Note that you need to have Confluent Cloud Schema Registry configured if using a schema-based message format like AVRO, JSON_SR, and PROTOBUF
  <br/>
  * Type: string
  * Default: JSON
  * Importance: high

`schemas.enable`
: Include schemas within each of the serialized values.
  <br/>
  * Type: boolean
  * Default: false
  * Importance: medium

`replace.null.with.default`
: Whether to replace fields that have a default value and that are null to the default value. When set to true, the default value is used, otherwise null is used.
  <br/>
  * Type: boolean
  * Default: true
  * Importance: medium

`ignore.default.for.nullables`
: When set to true, this property ensures that the corresponding record in Kafka is NULL, instead of showing the default column value.
  <br/>
  * Type: boolean
  * Default: false
  * Importance: medium

### Number of tasks for this connector

`tasks.max`
: Maximum number of tasks for the connector.
  <br/>
  * Type: int
  * Valid Values: [1,…]
  * Importance: high

### Auto-restart policy

`auto.restart.on.user.error`
: Enable connector to automatically restart on user-actionable errors.
  <br/>
  * Type: boolean
  * Default: true
  * Importance: medium

### Additional Configs

`header.converter`
: The converter class for the headers. This is used to serialize and deserialize the headers of the messages.
  <br/>
  * Type: string
  * Importance: low

`producer.override.compression.type`
: The compression type for all data generated by the producer. Valid values are none, gzip, snappy, lz4, and zstd.
  <br/>
  * Type: string
  * Importance: low

`value.converter.allow.optional.map.keys`
: Allow optional string map key when converting from Connect Schema to Avro Schema. Applicable for Avro Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.auto.register.schemas`
: Specify if the Serializer should attempt to register the Schema.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.connect.meta.data`
: Allow the Connect converter to add its metadata to the output schema. Applicable for Avro Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.enhanced.avro.schema.support`
: Enable enhanced schema support to preserve package information and Enums. Applicable for Avro Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.enhanced.protobuf.schema.support`
: Enable enhanced schema support to preserve package information. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.flatten.unions`
: Whether to flatten unions (oneofs). Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.generate.index.for.unions`
: Whether to generate an index suffix for unions. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.generate.struct.for.nulls`
: Whether to generate a struct variable for null values. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.int.for.enums`
: Whether to represent enums as integers. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.latest.compatibility.strict`
: Verify latest subject version is backward compatible when use.latest.version is true.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.object.additional.properties`
: Whether to allow additional properties for object schemas. Applicable for JSON_SR Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.optional.for.nullables`
: Whether nullable fields should be specified with an optional label. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.optional.for.proto2`
: Whether proto2 optionals are supported. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.use.latest.version`
: Use latest version of schema in subject for serialization when auto.register.schemas is false.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.use.optional.for.nonrequired`
: Whether to set non-required properties to be optional. Applicable for JSON_SR Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.wrapper.for.nullables`
: Whether nullable fields should use primitive wrapper messages. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`value.converter.wrapper.for.raw.primitives`
: Whether a wrapper message should be interpreted as a raw primitive at root level. Applicable for Protobuf Converters.
  <br/>
  * Type: boolean
  * Importance: low

`key.converter.key.schema.id.serializer`
: The class name of the schema ID serializer for keys. This is used to serialize schema IDs in the message headers.
  <br/>
  * Type: string
  * Default: io.confluent.kafka.serializers.schema.id.PrefixSchemaIdSerializer
  * Importance: low

`key.converter.key.subject.name.strategy`
: How to construct the subject name for key schema registration.
  <br/>
  * Type: string
  * Default: TopicNameStrategy
  * Importance: low

`value.converter.decimal.format`
: Specify the JSON/JSON_SR serialization format for Connect DECIMAL logical type values with two allowed literals:
  <br/>
  BASE64 to serialize DECIMAL logical types as base64 encoded binary data and
  <br/>
  NUMERIC to serialize Connect DECIMAL logical type values in JSON/JSON_SR as a number representing the decimal value.
  <br/>
  * Type: string
  * Default: BASE64
  * Importance: low

`value.converter.flatten.singleton.unions`
: Whether to flatten singleton unions. Applicable for Avro and JSON_SR Converters.
  <br/>
  * Type: boolean
  * Default: false
  * Importance: low

`value.converter.reference.subject.name.strategy`
: Set the subject reference name strategy for value. Valid entries are DefaultReferenceSubjectNameStrategy or QualifiedReferenceSubjectNameStrategy. Note that the subject reference name strategy can be selected only for PROTOBUF format with the default strategy being DefaultReferenceSubjectNameStrategy.
  <br/>
  * Type: string
  * Default: DefaultReferenceSubjectNameStrategy
  * Importance: low

`value.converter.value.schema.id.serializer`
: The class name of the schema ID serializer for values. This is used to serialize schema IDs in the message headers.
  <br/>
  * Type: string
  * Default: io.confluent.kafka.serializers.schema.id.PrefixSchemaIdSerializer
  * Importance: low

`value.converter.value.subject.name.strategy`
: Determines how to construct the subject name under which the value schema is registered with Schema Registry.
  <br/>
  * Type: string
  * Default: TopicNameStrategy
  * Importance: low

<a id="cc-amazon-sqs-record-schemas"></a>

## Record Schemas

The Amazon SQS Source connector creates records using following schemas.

### Key Schema

The Key is a `struct` with the following fields:

| Field Name     | Schema Type   | Optional?   | Description                                                           |
|----------------|---------------|-------------|-----------------------------------------------------------------------|
| QueueUrl       | string        | mandatory   | The fully qualified SQS queue URL from which the record is generated. |
| MessageId      | string        | mandatory   | The unique message ID of the message within Amazon SQS.               |
| MessageGroupId | string        | optional    | For FIFO queues, this is the message group ID.                        |

### Value Schema

The Value is a `struct` with the following fields:

| Field Name                       | Schema Type   | Optional?   | Description                                                                                                                                   |
|----------------------------------|---------------|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| Body                             | string        |             | The body of the SQS message.                                                                                                                  |
| ApproximateFirstReceiveTimestamp | int64         |             | Returns the time the message was first received from the queue (epoch time in milliseconds).                                                  |
| ApproximateReceiveCount          | int32         |             | Returns the number of times a message has been received across all queues but not deleted.                                                    |
| SenderId                         | string        |             | The IAM user or role that sent this message to SQS.                                                                                           |
| SentTimestamp                    | int64         |             | Returns the time the message was sent to the queue (epoch time in milliseconds                                                                |
| MessageDeduplicationId           | string        | Optional    | Returns the value provided by the producer that calls the SendMessage action.                                                                 |
| MessageGroupId                   | string        | Optional    | Returns the value provided by the producer that calls the SendMessage action. Messages with the same MessageGroupId are returned in sequence. |
| SequenceNumber                   | string        |             | Returns the value provided by Amazon SQS.                                                                                                     |

For more information, see [Request Parameters](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html#API_ReceiveMessage_RequestParameters).

### Header Schema

Each message attribute in SQS is converted to a Header in Kafka.

* The header key is the name of the message attribute.
* The header value is the value of the message attribute.
* The header schema depends on the data type of the message attribute.
  - String message attributes use a string schema.
  - Number message attributes use a string schema.
  - Binary message attributes use a bytes schema.
  - Custom message attributes use either string or bytes, depending on the type of custom attribute.

For more information, see [Message attribute components](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#message-attribute-components).

## Frequently asked questions

Find answers to frequently asked questions about the Amazon SQS Source connector for Confluent Cloud.

### Why is my connector unable to connect through provider integration?

If your connector fails to connect using AWS provider integration, verify the following:

* Ensure your IAM role has the required SQS permissions:
  > ```json
  > {
  >   "confluent_resource": "SQS Source Connector",
  >   "policy_document": {
  >     "Version": "2012-10-17",
  >     "Statement": [
  >       {
  >         "Effect": "Allow",
  >         "Action": [
  >           "sqs:ReceiveMessage",
  >           "sqs:DeleteMessage"
  >         ],
  >         "Resource": [
  >           "arn:aws:sqs:*:*:<queue-name>"
  >         ]
  >       }
  >     ]
  >   }
  > }
  > ```
* Verify that the trust relationship in your IAM role allows Confluent to assume the role.
* Check that the provider integration is correctly configured in Confluent Cloud with the proper AWS account ID and IAM role ARN.
* Ensure the AWS region specified in the connector configuration matches the region where your SQS queue is located.
* For cross-account access, verify that the AWS account containing the SQS queue trusts the Confluent service account.

### What are common configuration errors for this connector?

Common configuration errors include:

* **Incorrect SQS URL format**: The `sqs.url` must be the full queue URL in the format `https://sqs.<region>.amazonaws.com/<account-id>/<queue-name>`. Do not use queue ARNs or queue names alone.
* **Mismatched region settings**: If you specify `sqs.region`, it must match the region in your `sqs.url`. The connector attempts to infer the region from the URL if `sqs.region` is not provided.
* **Incorrect output format**: If using a schema-based format, ensure Confluent Cloud Schema Registry is enabled and properly configured.
* **Insufficient tasks for throughput**: Set `tasks.max` appropriately. For high-throughput queues, configure more tasks to improve performance.

### Why can’t my connector clear messages from the SQS queue?

If messages remain in your SQS queue after the connector processes them, check the following:

* Check the connector status in Confluent Cloud. If the connector is in a `Failed` or `Paused` state, messages will not be deleted.
* Review the connector logs for any errors related to message deletion or acknowledgment.
* Ensure the queue’s visibility timeout is appropriately configured. If the timeout is too short, messages may become visible again before the connector can delete them.
* If you recently upgraded the connector, verify that the new version is compatible with your queue configuration.

### How do I handle schema validation errors?

Schema validation errors typically occur when the data format does not match the expected schema. To troubleshoot:

* Verify that the SQS message body is properly formatted for your chosen output format.
* If using Confluent Cloud Schema Registry, ensure the schema is registered and the connector is configured to use it correctly.
* Check that the `output.data.format` property matches your actual message format.
* Review connector logs for specific schema validation error messages.
* For schemaless JSON format, ensure the message body contains valid JSON.

### Why is my connector stuck in a `Provisioning` state?

If the connector remains in the `Provisioning` state for an extended period:

* Verify that your Confluent Cloud environment and Kafka cluster are healthy and not experiencing issues.
* Check that the SQS queue exists and is accessible from Confluent Cloud with correctly configured authentication.
* Review the connector configuration for errors, particularly the `sqs.url` and `sqs.region` properties.
* Verify that network connectivity is established between Confluent Cloud and AWS by ensuring that security groups, network ACLs, and VPC configurations permit traffic to your SQS queue.

If the issue persists, contact [Confluent Support](https://support.confluent.io) with your connector ID and environment details.

### Can I use the same IAM role for multiple SQS Source connectors?

Yes, you can reuse the same IAM role for multiple SQS Source connectors, provided the role has permissions to access all the SQS queues that the connectors need to read from. Ensure the IAM policy includes permissions for all relevant queue ARNs:

```json
{
   "confluent_resource": "SQS Source Connector",
   "policy_document": {
     "Version": "2012-10-17",
     "Statement": [
       {
         "Effect": "Allow",
         "Action": [
           "sqs:ReceiveMessage",
           "sqs:DeleteMessage"
         ],
         "Resource": [
           "arn:aws:sqs:us-east-1:123456789012:queue-1",
           "arn:aws:sqs:us-east-1:123456789012:queue-2",
           "arn:aws:sqs:us-west-2:123456789012:queue-3"
         ]
       }
     ]
   }
 }
```

This approach simplifies management but requires careful permission scoping to maintain security.

### What happens if my SQS queue is deleted while the connector is running?

If your SQS queue is deleted while the connector is running:

* The connector will enter a `Failed` state.
* Error messages in the connector logs will indicate that the queue cannot be found.
* No data loss occurs for messages already written to Kafka.
* Messages that were in the SQS queue at the time of deletion are lost unless you have backups configured.

To recover:

1. Recreate the SQS queue with the same name and configuration.
2. Restart the connector.
3. Verify that the connector resumes processing and transitions to a `Running` state.

## Next Steps

* For an example that shows fully managed Confluent Cloud connectors in action with
  Confluent Cloud for Apache Flink, see the [Cloud ETL Demo](/platform/current/tutorials/examples/cloud-etl/docs/index.html).
  This example also shows how to use Confluent CLI to manage your resources in
  Confluent Cloud.
  [![image](images/topology.png)](https://docs.confluent.io/platform/current/tutorials/examples/cloud-etl/docs/index.html)
* Try [Confluent Cloud on AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-g5ujul6iovvcy?trk=14575e70-1766-4f20-8083-0c2757a1ec75&sc_channel=el)
  with $1000 of free usage for 30 days, and pay as you go. No credit card is
  required.
