Packages

c

monix.connect.sqs.consumer

DeletableMessage

class DeletableMessage extends ConsumedMessage

Represents a message consumed with manual delete, meaning that it provides control over when the message is considered processed and wants to be deleted from the source queue so that the next message can be consumed.

And that functionality is exposed by the deleteFromQueue method.

Source
DeletableMessage.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DeletableMessage
  2. ConsumedMessage
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. val attributes: Map[MessageSystemAttributeName, String]
    Definition Classes
    ConsumedMessage
  6. val body: String
    Definition Classes
    ConsumedMessage
  7. def changeVisibilityTimeout(timeout: FiniteDuration): Task[Unit]
    Definition Classes
    ConsumedMessage
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. def deleteFromQueue(): Task[Unit]

    Deletes the message from the source queue.

    Deletes the message from the source queue. Attempting to delete an already removed message will fail. This could happen in cases where a message is consumed twice (due the processing taking longer than the visibilityTimeout), and attempting to delete in both cases. In order to avoid this situation to happen, you could: - Increase the visibilityTimeout. - Recover from the failure. I.E using attempt.

    Example

    import monix.connect.sqs.consumer.DeletableMessage
    import monix.connect.sqs.domain.QueueName
    import monix.connect.sqs.Sqs
    import cats.effect.Resource
    import monix.eval.Task
    import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider
    import software.amazon.awssdk.regions.Region
    val defaultCredentials = DefaultCredentialsProvider.create()
    Sqs.create(defaultCredentials, Region.AWS_GLOBAL).use{ sqs =>
      for {
        queueUrl <- sqs.operator.getQueueUrl(QueueName("my-queue"))
        messages <- sqs.consumer.receiveSingleManualDelete(queueUrl)
        _ <- Task.parTraverse(messages)(_.deleteFromQueue()).attempt
      } yield ()
    }
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  13. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. val md5OfBody: String
    Definition Classes
    ConsumedMessage
  17. val message: Message
    Attributes
    protected
    Definition Classes
    DeletableMessageConsumedMessage
  18. val messageId: String
    Definition Classes
    ConsumedMessage
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. val queueUrl: QueueUrl
    Definition Classes
    DeletableMessageConsumedMessage
  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from ConsumedMessage

Inherited from AnyRef

Inherited from Any

Ungrouped