zio.sqs.producer
Members list
Type members
Classlikes
Publishes events of type T to an SQS queue. Create an instance with Producer.make inside a Scope, then publish with the methods below.
Publishes events of type T to an SQS queue. Create an instance with Producer.make inside a Scope, then publish with the methods below.
import zio._
import zio.aws.sqs.Sqs
import zio.sqs.producer._
import zio.sqs.serialization.Serializer
def publish(queueUrl: String): ZIO[Sqs, Throwable, Unit] =
ZIO.scoped {
for {
producer <- Producer.make(queueUrl, Serializer.serializeString)
_ <- producer.produce(ProducerEvent("hello"))
} yield ()
}
Type parameters
- T
-
type of the event to publish
Attributes
- Companion
- object
- Source
- Producer.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Factory for Producer.
Factory for Producer.
Attributes
- Companion
- trait
- Source
- Producer.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Producer.type
Factory and recoverability check for ProducerError.
Factory and recoverability check for ProducerError.
Attributes
- Companion
- class
- Source
- ProducerError.scala
- Supertypes
- Self type
-
ProducerError.type
Encodes an error for the published message. Its getMessage has the form senderFault: , code: <code>, message:. Fields senderFault, code, message correspond to the respective fields in BatchResultErrorEntry
Encodes an error for the published message. Its getMessage has the form senderFault: , code: <code>, message:. Fields senderFault, code, message correspond to the respective fields in BatchResultErrorEntry
Type parameters
- T
-
type of the event.
Value parameters
- code
-
an error code representing why the action failed on this entry.
- event
-
event that caused this failure.
- message
-
a message explaining why the action failed on this entry.
- senderFault
-
whether the error happened due to the caller of the batch API action.
Attributes
- Companion
- object
- Source
- ProducerError.scala
- Supertypes
Event to publish to SQS.
Event to publish to SQS.
Type parameters
- T
-
type of the payload for the event.
Value parameters
- attributes
-
a map of attributes to set.
- data
-
payload to publish.
- deduplicationId
-
token used for deduplication of sent messages.
- delay
-
in order to delay delivery of the message. Allowed values: 0 to 15 minutes. The producer sends the whole seconds of the delay; any fraction of a second is dropped.
- groupId
-
assigns a specific message group to the message.
Attributes
- Companion
- object
- Source
- ProducerEvent.scala
- Supertypes
Factory for ProducerEvent.
Factory for ProducerEvent.
Attributes
- Companion
- class
- Source
- ProducerEvent.scala
- Supertypes
- Self type
-
ProducerEvent.type
Settings for the producer. Creating the settings with a batchSize above 10 throws a java.lang.IllegalArgumentException.
Settings for the producer. Creating the settings with a batchSize above 10 throws a java.lang.IllegalArgumentException.
Value parameters
- 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 maximum number of retries for an event that fails with a recoverable error (see ProducerError.isRecoverable).
Attributes
- Source
- ProducerSettings.scala
- Supertypes
Types
Specifies the result of publishing en event. The result either an error zio.sqs.producer.ProducerError or the event itself zio.sqs.producer.ProducerEvent
Specifies the result of publishing en event. The result either an error zio.sqs.producer.ProducerError or the event itself zio.sqs.producer.ProducerEvent
Type parameters
- T
-
type of the event to publish
Attributes
- Source
- package.scala