Object/Trait

com.spingo.op_rabbit

RecoveryStrategy

Related Docs: trait RecoveryStrategy | package op_rabbit

Permalink

object RecoveryStrategy

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RecoveryStrategy
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def abandonedQueue(defaultTTL: FiniteDuration = 1.day, abandonQueueName: (String) ⇒ String = q => s"op-rabbit.abandoned.$q", abandonQueueProperties: List[Header] = Nil, exchange: Exchange[Direct.type] = Exchange.default): RecoveryStrategy

    Permalink

    Places copy of message into a queue with "op-rabbit.abandoned." prepended (configurable); after ttl (default of 1 day), these messages are dropped.

    Places copy of message into a queue with "op-rabbit.abandoned." prepended (configurable); after ttl (default of 1 day), these messages are dropped. Exception is stored in x-exception header; original routing information stored in x-original-routing-key and x-original-exchange.

    defaultTTL

    - How long abandoned messages should stay in the queue.

  5. def apply(fn: (String, Channel, Throwable) ⇒ Handler): RecoveryStrategy

    Permalink
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. def limitedRedeliver(redeliverDelay: FiniteDuration = 10.seconds, retryCount: Int = 3, onAbandon: RecoveryStrategy = nack(false), retryQueueName: (String) ⇒ String = q => s"op-rabbit.retry.$q", retryQueueProperties: List[Header] = Nil, exchange: Exchange[Direct.type] = Exchange.default): RecoveryStrategy { def genRetryBinding(queueName: String): com.spingo.op_rabbit.Binding }

    Permalink

    Recovery strategy which redelivers messages a limited number of times.

    Recovery strategy which redelivers messages a limited number of times. Violates message ordering guarantees.

    For a definition of what constitutes failure, see RecoveryStrategy.

    In the event of a failure, the following happens:

    • The message header x-retry is read to determine if there are retries remaining.
    • If retries are exhausted, then fallback to provided onAbandon handler.
    • Otherwise, publish a new copy of the message to the configurable, passively created retryQueue. It is of vital importance that you read the queue caveats related noted below.
      • x-retry is incremented.
      • The passive-queue definition is attempted at every retry. This leads to more IO but prevents the queue from expiring and basicPublish being none-the-wiser.
      • The message copy is published using channel.basicPublish. Sometime after, using the same channel, the original message is acknowledged, using the same channel. This means two things:

    1) The publish could succeed and the acknowledgement could fail, leading to a duplication of the message. An IO exception or network event at the right time could cause this.

    2) In certain clustering configurations, it might be possible for the basicPublish to fail, but the acknowledgement to succeed. The failure case would require that the the message queue and the redelivery queue are on different cluster nodes, and that one can be reached but the other is not. Plan as needed. An implementation using transactions (slow) / asynchronous publisher confirms (faster) may be warranted.

    • The message copy is re-inserted into the queue using the default (direct) exchange. This means that the second time around, if a direct-exchange wasn't used to initially route the message into the queue, then the routingKey will be modified. See the message header x-original-routing-key for the original routing key.

    retryQueue passive creations CAVEATS!!!

    The retry queue is created passively. This allows the retryQueue to be used without error in the case of a configuration change (in cases where a crash would be worse), but means that configuration changes done after the initial creation of the queue will not propagate. As a result, if you want to guarantee that changes made to your redelivery strategy propagate that you modify retryQueueName function such that it will create a new redelivery queue. The old, unused one will expire, after an idle period of redeliveryDelay * 3.

    Also, it is vitally important that for every input queue-name of the retryQueueName, a unique value is returned. In other words, DO NOT TRY AND CONSOLIDATE REDELIVERY QUEUES.

    retryCount

    The number of times to retry. A value of 3 will result in 4 attempts, including the initial.

    onAbandon

    The strategy to be used once the retryCount is exhausted. Defaults to nack(false).

  15. def nack(requeue: Boolean = false): RecoveryStrategy

    Permalink

    Nack (reject) the message.

    Nack (reject) the message.

    requeue

    Whether the message should be requeued for delivery. Note: true could cause an infinite loop

  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. val none: RecoveryStrategy

    Permalink

    No recovery strategy; cause the consumer to shutdown with an exception.

  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. val originalExchange: Directive[::[String, HNil]]

    Permalink

    directive which extracts the x-original-exchange, if present.

    directive which extracts the x-original-exchange, if present. Falls back to envelope exchange.

  21. val originalRoutingKey: Directive[::[String, HNil]]

    Permalink

    directive which extracts the x-original-routing-key, if present.

    directive which extracts the x-original-routing-key, if present. Falls back to envelope routing key.

  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. val x-exception: UnboundTypedHeader[String]

    Permalink

    Header at which the formatted exception is stored.

  28. val x-original-exchange: UnboundTypedHeader[String]

    Permalink

    The original exchange used before redeliver attempts

  29. val x-original-routing-key: UnboundTypedHeader[String]

    Permalink

    The original routing key before redeliver attempts

  30. val x-retry: UnboundTypedHeader[Int]

    Permalink

    The message header used to track retry attempts.

Inherited from AnyRef

Inherited from Any

Ungrouped