package producer
Type Members
- final case class FifoMessage(body: String, groupId: String, deduplicationId: Option[String] = Option.empty, messageAttributes: Map[String, MessageAttribute] = Map.empty, awsTraceHeader: Option[MessageAttribute] = Option.empty) extends Message with Product with Serializable
The message representation to be sent to a FIFO queue.
The message representation to be sent to a FIFO queue.
- body
message content
- messageAttributes
structured metadata (such as timestamps, signatures, and identifiers) that goes alongside the message. and that the consumer can use it to handle a in a particular way without having to process the message body first. Each message can have up to 10 attributes. See more in the SQS AWS Message Attributes gide..
- awsTraceHeader
a message system attribute to carry the X-Ray trace header with messages in the queue. Its type must be String and its value must be a correctly formatted AWS X-Ray trace header string. The size of a message system attribute doesn't count towards the total size of a message. See more in the Xray sqs service docs..
- See also
- class Message extends AnyRef
Generic abstraction for queue messages, which will be implemented differently for standard and fifo queue messages.
Generic abstraction for queue messages, which will be implemented differently for standard and fifo queue messages.
This class has a private constructor as it should not be used directly, use one of its implementations StandardMessage or FifoMessage.
The reason for that distinction is to make the api easier and transparent to use on the user side, because different queues expect different attributes, for example a FifoMessage has
groupId
anddeduplicaitonId
, but that is not valid for standard queues. On the other hand StandardMessages acceptdelayDurations
, which are not allowed in fifo implementation. Thus it enforces the user to use the right attributes for their use case. - class SqsProducer extends AnyRef
- final case class StandardMessage(body: String, messageAttributes: Map[String, MessageAttribute] = Map.empty, awsTraceHeader: Option[MessageAttribute] = None, delayDuration: Option[FiniteDuration] = None) extends Message with Product with Serializable
The message type representation to be sent to a Standard Sqs queue.
The message type representation to be sent to a Standard Sqs queue.
The main differences between FifoMessage is that it does not need
deduplication
norgroupId
, on the other hand it can containdelayDuration
, which is not supported in fifo queues.- body
message content
- messageAttributes
structured metadata (such as timestamps, signatures, and identifiers) that goes alongside the message. and that the consumer can use it to handle a in a particular way without having to process the message body first. Each message can have up to 10 attributes. See more in the SQS AWS Message Attributes gide..
- awsTraceHeader
a message system attribute to carry the X-Ray trace header with messages in the queue. Its type must be String and its value must be a correctly formatted AWS X-Ray trace header string. The size of a message system attribute doesn't count towards the total size of a message. See more in the Xray sqs service docs..
- delayDuration
The length of time, in seconds, for which a specific message is delayed. Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive DelaySeconds value become available for processing after the delay period is finished. If you don't specify a value, the default value for the queue is applied. FifoMessages do not support this field because it is not supported by FifoQueues. You can set this parameter only on a queue level.
- See also