Because topology recovery strategy configuration is crucial to how op-rabbit works, we don't allow some options to be specified
Because topology recovery strategy configuration is crucial to how op-rabbit works, we don't allow some options to be specified
Modeling the allowed options via a case-class allows the compiler to tell the library user which options aren't allowed.
Represents a message delivery for usage in consumers / Handlers.
Directives power the declarative DSL of op-rabbit.
Directives power the declarative DSL of op-rabbit.
In order to define a consumer, you need a channel directive, a consumer directive, and one or more extractor directives. For example:
channel(qos = 3) { consume(queue("my.queue.name")) { (body(as[MyPayloadType]) & optionalProperty(ReplyTo) & optionalProperty(Priority)) { (myPayload, replyTo, priority) => // work ... ack } } }
As seen, directives are composable via &
. In the end, the directive is applied with a function whose parameters match the output values from the directive(s).
One value of the directives, as opposed to accessing the AMQP properties directly, is that they are type safe, and care was taken to reduce the probability of surprise. Death is swiftly issued to null
and Object
. Some directives, such as property, will nack the message if the value specified can't be extracted; IE it is null. If you'd prefer to use a default value instead of nacking the message, you can specify alternative values using | provide(...)
.
(property(ReplyTo) | provide("default-reply-to") { replyTo => // ... }
Note: the directives themselves don't actually do anything, except when applied / returned. IE:
channel(qos = 3) { consume(queue("my.queue.name")) { property(ReplyTo) // does absolutely nothing body(as[MyPayloadType]) { (myPayload, replyTo, priority) => ack // this ack here does absolutely nothing (not the return value) // work ... ack } } }
Common interface for how exchanges are defined.
Common interface for how exchanges are defined.
See:
This exception is thrown when a RabbitUnmarshaller tries to unmarshall a message with the wrong contentType specified in the header.
Confirmed Message container.
Confirmed Message container. Send to RabbitControl actor for delivery. Upon delivery confirmation, RabbitControl will respond to the sender with true
.
Use the factory method Message$.apply to instantiate one of these using an implicit RabbitMarshaller for serialization.
Basic interface; send to RabbitControl actor for delivery.
This exception is thrown when a RabbitUnmarshaller tries to unmarshall a message with the wrong contentType specified in the header.
RabbitControl is the top-level actor which handles the following:
RabbitControl is the top-level actor which handles the following:
- Pull configuration from the rabbitmq config block, and establish connection to RabbitMQ - Manage subscriptions
RabbitControl accepts the following commands / queries:
akka-rabbitmq
ConnectionActorBasic trait for reporting error messages; implement to build your own error reporting strategies to be used with consumers
This trait is used to serialize messages for publication; it configures a property builder and sets the appropriate headers
This trait is used to serialize messages for publication; it configures a property builder and sets the appropriate headers
This trait is used to deserialize messages from binary format for use in Consumers; it checks and honors the contentType / encoding message headers, as appropriate.
This trait is used to deserialize messages from binary format for use in Consumers; it checks and honors the contentType / encoding message headers, as appropriate.
Instructs RabbitMQ what to do in the event of a consumer failure, failure being defined as the handler throwing an
exception, the fail
directive being used, or ack(Future.failed(ex))
/ ack(Failure(ex))
.
Instructs RabbitMQ what to do in the event of a consumer failure, failure being defined as the handler throwing an
exception, the fail
directive being used, or ack(Future.failed(ex))
/ ack(Failure(ex))
.
By contract, RecoveryStrategy accept a queueName, channel, and exception, and return a Handler whose status dictates the fate of the recovered message. A RecoveryStratregy should not do any asynchronous work involving the provided channel
Send this message to RabbitControl to check the status of our connection to the RabbitMQ broker.
A Subscription contains a full definition for a consumer (channel, binding, handling, error recovery, reportings, etc.) subscription
A Subscription contains a full definition for a consumer (channel, binding, handling, error recovery, reportings, etc.) subscription
This object is sent to RabbitControl to boot.
Example instantiation:
Subscription { import Directives._
channel(qos = 1) { consume(queue("such-queue")) { body(as[String]) { payload => // do work... ack } } } }
Pull binary message payload raw, without any serialization.
Pull binary message payload raw, without any serialization. An implicit is defined in RabbitUnmarshaller$.binaryUnmarshaller and RabbitMarshaller$.binaryUnmarshaller
Convenience object and recommended way for bringing the directives in scope.
Convenience object and recommended way for bringing the directives in scope. See Directives trait.
Confirmed message generator.
Confirmed message generator. See Message$
Reports consumer errors to Slf4j.
Converts binary message to a UTF8 string, and back.
Converts binary message to a UTF8 string, and back. An implicit is defined in RabbitUnmarshaller$.stringMarshaller and RabbitMarshaller$.stringMarshaller
(Since version 1.0.2) LogbackLogger has been renamed to Slf4jLogger