This connector is available as a built-in connector on StreamNative Cloud.

Quick start
Prerequisites
The prerequisites for connecting an AWS SQS source connector to external systems include:- Create SQS in AWS.
- Create the AWS User and create
AccessKey(Please recordAccessKeyandSecretAccessKey). - Assign the following permissions to the AWS User:
- sqs:CreateQueue
- sqs:DeleteMessage
- sqs:ChangeMessageVisibility
- sqs:GetQueueUrl
- sqs:GetQueueAttributes
- sqs:ReceiveMessage
1. Create a connector
The following command shows how to use pulsarctl to create abuiltin connector. If you want to create a non-builtin connector,
you need to replace --source-type sqs with --archive /path/to/pulsar-io-sqs.nar. You can find the button to download the nar package at the beginning of the document.
If you are a StreamNative Cloud user, you need set up your environment first.
--source-config is the minimum necessary configuration for starting this connector, and it is a JSON string. You need to substitute the relevant parameters with your own.
If you want to configure more parameters, see Configuration Properties for reference.
You can also choose to use a variety of other tools to create a connector:
- pulsar-admin: The command arguments for
pulsar-adminare similar to those ofpulsarctl. You can find an example for StreamNative Cloud Doc. - RestAPI: You can find an example for StreamNative Cloud Doc.
- Terraform: You can find an example for StreamNative Cloud Doc.
- Function Mesh: The docker image can be found at the beginning of the document.
2. Send messages to AWS SQS
You can use the following simple code to send messages to AWS SQS.3. Show data using Pulsar client
If your connector is created on StreamNative Cloud, you need to authenticate your clients. See Build applications using Pulsar clients for more information.
Configuration Properties
Before using the AWS SQS source connector, you need to configure it. This table outlines the properties and the Descriptions of an AWS SQS source connector.The
batchSizeOfOnceReceive and numberOfConsumers options are available for SQS source 2.8.4.3+, 2.9.4.1+, and 2.10.1.13+. The sourceQueueOfferTimeoutMs, ackFailRetryMaxAttempts, ackFailRetryInitialDelayMs, and receive retry settings are connector-level source options and do not require additional Pulsar Functions runtime knobs. For details about how to test AWS SQS source performance, see Performance Test on AWS SQS Source Connector.numberOfConsumers and sourceQueueSize, and set sourceQueueOfferTimeoutMs so the source fails messages back to SQS instead of blocking receive threads indefinitely.
Configure AwsCredentialProviderPlugin
AWS SQS source connector allows you to use three ways to connect to AWS SQS by configuringawsCredentialPluginName.
-
Leave
awsCredentialPluginNameempty to get the connector authenticated by passingaccessKeyandsecretKeyinawsCredentialPluginParam. -
Set
awsCredentialPluginNametoorg.apache.pulsar.io.aws.AwsDefaultProviderChainPluginto use the default AWS provider chain. With this option, you don’t need to configureawsCredentialPluginParam. For more information, see AWS documentation. -
Set
awsCredentialPluginNametoorg.apache.pulsar.io.aws.STSAssumeRoleProviderPluginto use the default AWS provider chain, and you need to configureroleArnandroleSessionNmaeinawsCredentialPluginParam. For more information, see AWS documentation.