Class AmazonSQSProducer
- All Implemented Interfaces:
AdaptrisComponent,AdaptrisMessageProducer,AdaptrisMessageSender,AdaptrisMessageWorker,ComponentLifecycle,ComponentLifecycleExtension,MessageEventGenerator
AdaptrisMessageProducer implementation that sends messages to an Amazon Web Services (AWS) SQS queue.
Amazon SQS receives only text therefore only the message payload is sent as a string.
- Since:
- 3.0.3
In the adapter configuration file this class is aliased as amazon-sqs-producer which is the preferred alternative to the fully qualified classname when building your configuration.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voiddoProduce(AdaptrisMessage msg, String endpoint) endpoint(AdaptrisMessage msg) Delay seconds for every messageThis parameter applies only to FIFO (first-in-first-out) queues.The AWS account ID of the account that created the queue.getQueue()The SQS Queue nameSpecify a list of a metadata keys that should be attached to a message.voidinit()protected Stringvoidprepare()voidsetDelaySeconds(Integer delaySeconds) Delay seconds for every messagevoidsetMessageGroupId(String messageGroupId) This parameter applies only to FIFO (first-in-first-out) queues.voidsetOwnerAwsAccountId(String ownerAwsAccountId) The AWS account ID of the account that created the queue.voidThe SQS Queue namevoidsetSendAttributes(@NonNull List<String> sendAttributes) Specify a list of a metadata keys that should be attached to a message.voidstart()voidstop()protected AmazonSQSProducerMethods inherited from class com.adaptris.core.ProduceOnlyProducerImp
produce, request, requestMethods inherited from class com.adaptris.core.AdaptrisMessageProducerImp
createNameMethods inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
createQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory, withUniqueIDMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueIdMethods inherited from interface com.adaptris.core.AdaptrisMessageWorker
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactoryMethods inherited from interface com.adaptris.core.MessageEventGenerator
createQualifier, isTrackingEndpoint
-
Constructor Details
-
AmazonSQSProducer
public AmazonSQSProducer()
-
-
Method Details
-
prepare
- Throws:
CoreException
-
init
- Throws:
CoreException
-
start
- Throws:
CoreException
-
stop
public void stop() -
close
public void close() -
doProduce
- Specified by:
doProducein classProduceOnlyProducerImp- Throws:
ProduceException
-
messageGroupId
- Throws:
Exception
-
withMessageAsyncCallback
protected AmazonSQSProducer withMessageAsyncCallback(AmazonSQSProducer.SendMessageAsyncCallback callback) -
endpoint
- Specified by:
endpointin classAdaptrisMessageProducerImp- Throws:
ProduceException
-
withQueue
-
getDelaySeconds
Delay seconds for every message -
setDelaySeconds
Delay seconds for every message -
getSendAttributes
Specify a list of a metadata keys that should be attached to a message.Amazon SQS supports a limited set of attributes (10 at current count) that can be attached to a message; use this list to specify the metadata keys that must be sent as attributes, otherwise all metadata is ignored.
-
setSendAttributes
Specify a list of a metadata keys that should be attached to a message.Amazon SQS supports a limited set of attributes (10 at current count) that can be attached to a message; use this list to specify the metadata keys that must be sent as attributes, otherwise all metadata is ignored.
-
getOwnerAwsAccountId
The AWS account ID of the account that created the queue. When omitted the default setting on the queue will be used. -
setOwnerAwsAccountId
The AWS account ID of the account that created the queue. When omitted the default setting on the queue will be used. -
getQueue
The SQS Queue name -
setQueue
The SQS Queue name -
getMessageGroupId
This parameter applies only to FIFO (first-in-first-out) queues.
The tag that specifies that a message belongs to a specific message group. Messages that belong to the same message group are processed in a FIFO manner (however, messages in different message groups might be processed out of order). To interleave multiple ordered streams within a single queue, use
MessageGroupIdvalues (for example, session data for multiple users).-
You must associate a non-empty
MessageGroupIdwith a message. If you don't provide aMessageGroupId, the action fails. -
ReceiveMessagemight return messages with multipleMessageGroupIdvalues. For eachMessageGroupId, the messages are sorted by time sent. The caller can't specify aMessageGroupId.
The length of
MessageGroupIdis 128 characters. Valid values: alphanumeric characters and punctuation(!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~).For best practices of using
MessageGroupId, see Using the MessageGroupId Property in the Amazon SQS Developer Guide.MessageGroupIdis required for FIFO queues. You can't use it for Standard queues.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
setMessageGroupId
This parameter applies only to FIFO (first-in-first-out) queues.
The tag that specifies that a message belongs to a specific message group. Messages that belong to the same message group are processed in a FIFO manner (however, messages in different message groups might be processed out of order). To interleave multiple ordered streams within a single queue, use
MessageGroupIdvalues (for example, session data for multiple users).-
You must associate a non-empty
MessageGroupIdwith a message. If you don't provide aMessageGroupId, the action fails. -
ReceiveMessagemight return messages with multipleMessageGroupIdvalues. For eachMessageGroupId, the messages are sorted by time sent. The caller can't specify aMessageGroupId.
The length of
MessageGroupIdis 128 characters. Valid values: alphanumeric characters and punctuation(!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~).For best practices of using
MessageGroupId, see Using the MessageGroupId Property in the Amazon SQS Developer Guide.MessageGroupIdis required for FIFO queues. You can't use it for Standard queues.- Parameters:
messageGroupId-
-
-