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
- Alphabetic
- By Inheritance
Inherited
- DeletableMessage
- ConsumedMessage
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val attributes: Map[MessageSystemAttributeName, String]
- Definition Classes
- ConsumedMessage
- val body: String
- Definition Classes
- ConsumedMessage
- def changeVisibilityTimeout(timeout: FiniteDuration): Task[Unit]
- Definition Classes
- ConsumedMessage
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- 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 () }
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val md5OfBody: String
- Definition Classes
- ConsumedMessage
- val message: Message
- Attributes
- protected
- Definition Classes
- DeletableMessage → ConsumedMessage
- val messageId: String
- Definition Classes
- ConsumedMessage
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val queueUrl: QueueUrl
- Definition Classes
- DeletableMessage → ConsumedMessage
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()