package producer
- Alphabetic
- By Inheritance
- producer
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
type
ErrorOrEvent[T] = Either[ProducerError[T], ProducerEvent[T]]
Specifies the result of publishing en event.
Specifies the result of publishing en event. The result either an error zio.sqs.producer.ProducerError or the event itself zio.sqs.producer.ProducerEvent
-
trait
Producer[T] extends AnyRef
Producer that can be used to publish an event of type T to SQS queue An instance of producer should be instantiated before publishing.
Producer that can be used to publish an event of type T to SQS queue An instance of producer should be instantiated before publishing.
// when publishing strings with the provided `client` to the given `queueUrl` producer = Producer.make(client, queueUrl, Serializer.serializeString)- T
type of the event to publish
-
final
case class
ProducerError[T](senderFault: Boolean, code: String, message: Option[String], event: ProducerEvent[T]) extends RuntimeException with Product with Serializable
Encodes an error for the published message Fields
senderFault,code,messagecorrespond to the respective fields in BatchResultErrorEntryEncodes an error for the published message Fields
senderFault,code,messagecorrespond to the respective fields in BatchResultErrorEntry- T
type of the event.
- senderFault
whether the error happened due to the caller of the batch API action.
- code
an error code representing why the action failed on this entry.
- message
a message explaining why the action failed on this entry.
- event
event that caused this failure.
-
final
case class
ProducerEvent[T](data: T, attributes: Map[String, MessageAttributeValue], groupId: Option[String], deduplicationId: Option[String], delay: Option[Duration] = None) extends Product with Serializable
Event to publish to SQS.
Event to publish to SQS.
- T
type of the payload for the event.
- data
payload to publish.
- attributes
a map of attributes to set.
- groupId
assigns a specific message group to the message.
- deduplicationId
token used for deduplication of sent messages.
- delay
in order to delay delivery of the message. Allowed values: 0 to 15 minutes.
-
final
case class
ProducerSettings(batchSize: Int = 10, duration: Duration = 500.millisecond, parallelism: Int = 16, retryDelay: Duration = 250.millisecond, retryMaxCount: Int = 10) extends Product with Serializable
Settings for the producer.
Settings for the producer.
- batchSize
size of the batch to use. Up to 10 messages can be buffered and sent as a batch request.
- duration
time to wait for the batch to be full (have the specified batchSize).
- parallelism
number of concurrent requests to make to SQS.
- retryDelay
time to wait before retrying event republishing if it failed with a recoverable error.
- retryMaxCount
the number of retries to make for a posted event.
Value Members
- object Producer
- object ProducerError extends Serializable
- object ProducerEvent extends Serializable