Object

com.spingo.op_rabbit.stream

RabbitSource

Related Doc: package stream

Permalink

object RabbitSource

Creates an op-rabbit consumer whose messages are delivered through an AckedSource. Message order guarantees are maintained.

IMPORTANT NOTE ON ACKNOWLEDGED MESSAGES

(if you are seeing unacknowledged messages accumulated, followed by the stream progress halting, you will want to pay special attention to this)

The 'Acked' variety of streams provide type-safe guarantees that acknowledgments aren't dropped on the floor. Filtering a message from the stream (via collect, filter, or mapConcat -> Nil), for example, will cause the incomming RabbitMQ message to be acknowledged.

If you begin constructing your own Acked components and interacting with the AckTup[T] type directly (or, (Promise[Unit], T)), you must take caution that the promise is not dropped on the floor. This means, every time an exception could be thrown, you must catch it and propagate said exception to the Promise by calling promise.fail(ex).

If you integrate with a stream compoment that does not support acknowledged streams, you will probably want to acknowledge the message before sending messages to it (by using the .acked acked-stream operation). If it is important that you acknowledge messages after the flow is complete, and the library doesn't provide a reliable way to propagate element exceptions, you will likely want exception to crash the stream (IE: don't resume the stream on exception). Otherwise, if using a resuming decider, you risk elements being dropped and unacknowledged messages accumulating.

Example:

import com.spingo.op_rabbit.Directives._
RabbitSource(
  rabbitControl,
  channel(qos = 3),
  consume(queue("such-queue", durable = true, exclusive = false, autoDelete = false)),
  body(as[Person])).
  runForeach { person =>
    greet(person)
  } // after each successful iteration the message is acknowledged.
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RabbitSource
  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 apply[L <: HList](rabbitControl: ActorRef, channelDirective: ChannelDirective, bindingDirective: BindingDirective, handler: Directive[L])(implicit tupler: HListToValueOrTuple[L], errorReporting: RabbitErrorLogging, recoveryStrategy: RecoveryStrategy): AckedSource[Out, SubscriptionRef]

    Permalink

    rabbitControl

    Op-rabbit management ActorRef

    channelDirective

    An unbound ChannelDirective

    bindingDirective

    An unbound BindingDirective; informs the stream from which queue it should pull messages.

    handler

    A Directive, either simple or compound, describing how the elements passed into the stream are to be formed.

  5. final def asInstanceOf[T0]: T0

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  16. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped