Extracts a JsObject
from an Amqp Delivery
message.
Extracts a JsObject
from an Amqp Delivery
message.
Usage:
amqpDelivery match { case AmqpDeliveryJsObject(json) => json.convertTo[Something] case Delivery(_, _, _, bodyInBytes) => // will only match if the message is not a valid json object }
Extracts a String
from an Amqp Delivery
message.
Extracts a String
from an Amqp Delivery
message.
Usage:
amqpDelivery match { case AmqpDeliveryString(string) => println(string) }
Converts a AmqpPublishJsObject
that receives a JsObject
, to an Amqp.Publish
.
Converts a AmqpPublishJsObject
that receives a JsObject
, to an Amqp.Publish
.
Converts a AmqpPublishString
that receives a String
, to an Amqp.Publish
.
Converts a AmqpPublishString
that receives a String
, to an Amqp.Publish
.
Creates a producer.
Creates a producer. When the broker has a connection to the channel, the handler actor will be notified that the producer is connected.
the actor to handle the channel state; it can receive the messages com.github.sstone.amqp.ChannelOwner.Disconnected, com.github.sstone.amqp.ChannelOwner.Connected or a com.github.sstone.amqp.Amqp.Error.
the actor ref of the producer
Create a rpc client
Create a rpc client
the actor to handle the channel state; it can receive the messages
the rpc client actor ref
Setup a RpcServer asynchronously.
Setup a RpcServer asynchronously. When the broker has a connection to the channel, the exchange and queues are declared and then it will start to process incoming messages.
The queue name can be None to create a One-To-Many (all servers/processors handle the request) or specified for a One-To-Any (only one server/processor will handle the request).
the exchange name
the routing key
the queue name
the actor to handle the channel state; it can receive the messages com.github.sstone.amqp.ChannelOwner.Disconnected, com.github.sstone.amqp.ChannelOwner.Connected or a com.github.sstone.amqp.Amqp.Error.
an optional message timeout to avoid filling up the queue with old, already ignored, responses
the function that processes an Delivery
the implicit execution context
the future with the queue name
Creates a producer which stashes messages until the producer is fully connected to the rmq.
Creates a producer which stashes messages until the producer is fully connected to the rmq.
the actor ref of the producer proxy.
Declare an exchange asynchronously.
Declare an exchange asynchronously. When the broker has a connection to the channel, the exchange will be declared.
the exchange name
the exchange type
the actor to handle the channel state; it can receive the messages com.github.sstone.amqp.ChannelOwner.Disconnected, com.github.sstone.amqp.ChannelOwner.Connected or a com.github.sstone.amqp.Amqp.Error.
the future that completes this exchange declaration
Declare a queue asynchronously.
Declare a queue asynchronously. When the broker has a connection to the channel, the queue will be declared.
the exchange name
the routing key
the queue name, pass None to generate one randomly
the actor to handle the channel state; it can receive the messages com.github.sstone.amqp.ChannelOwner.Disconnected, com.github.sstone.amqp.ChannelOwner.Connected or a com.github.sstone.amqp.Amqp.Error.
true if the queue will be read by an external client
the future with the queue name
Dispatches a request message from the client and returns a Future of a response
Dispatches a request message from the client and returns a Future of a response
the request message
the callback handler for the response
a Future of the return of the callback of the rpc response
Dispatches a request message with a Future of a concrete response type.
Dispatches a request message with a Future of a concrete response type.
the type of the request message with a JsonWriter
the response type that the callback returns
the request message
the evidence to support the serialization of a concrete type Resp
the json writer for type Req
the json reader for type Resp
a Future of the expected response message
Bind a specific queue to a given actor asynchronously.
Bind a specific queue to a given actor asynchronously. When the broker has a connection to the channel, the queue is declared and bound to the given actor.
the actor which will listen to the queue
the exchange name
the routing key
the queue name, pass None to generate one randomly
if true, the queue will be destroyed when it is no longer used
the actor to handle the channel state; it can receive the messages com.github.sstone.amqp.ChannelOwner.Disconnected, com.github.sstone.amqp.ChannelOwner.Connected or a com.github.sstone.amqp.Amqp.Error.
true if the queue will be read by an external client
the future with the consumer actor and the queue name
Bind a specific queue to a given actor asynchronously.
Bind a specific queue to a given actor asynchronously. When the broker has a connection to the channel, the queue is declared and bound to the given actor.
the actor which will listen to the queue
the exchange name
the routing key
the queue name, pass None to generate one randomly
if true, the queue will be destroyed when it is no longer used
the actor to handle the channel state; it can receive the messages com.github.sstone.amqp.ChannelOwner.Disconnected, com.github.sstone.amqp.ChannelOwner.Connected or a com.github.sstone.amqp.Amqp.Error.
true if the queue will be read by an external client
the future with the queue name
This trait abstracts the creation and communication logic of a Rpc client.