public class Sender extends Object implements AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
Sender.ConfirmSendContext<OMSG extends OutboundMessage> |
static class |
Sender.SendContext<OMSG extends OutboundMessage> |
Constructor and Description |
---|
Sender() |
Sender(SenderOptions options) |
Modifier and Type | Method and Description |
---|---|
Mono<com.rabbitmq.client.AMQP.Queue.BindOk> |
bind(BindingSpecification specification)
Bind a queue to an exchange.
|
Mono<com.rabbitmq.client.AMQP.Queue.BindOk> |
bind(BindingSpecification specification,
ResourceManagementOptions options)
Bind a queue to an exchange.
|
Mono<com.rabbitmq.client.AMQP.Exchange.BindOk> |
bindExchange(BindingSpecification specification)
Bind an exchange to another exchange.
|
Mono<com.rabbitmq.client.AMQP.Exchange.BindOk> |
bindExchange(BindingSpecification specification,
ResourceManagementOptions options)
Bind an exchange to another exchange.
|
Mono<com.rabbitmq.client.AMQP.Queue.BindOk> |
bindQueue(BindingSpecification specification)
Bind a queue to an exchange.
|
Mono<com.rabbitmq.client.AMQP.Queue.BindOk> |
bindQueue(BindingSpecification specification,
ResourceManagementOptions options)
Bind a queue to an exchange.
|
protected <T> Mono<T> |
cache(Mono<T> mono) |
void |
close() |
protected Scheduler |
createScheduler(String name) |
Mono<com.rabbitmq.client.AMQP.Exchange.DeclareOk> |
declare(ExchangeSpecification specification) |
Mono<com.rabbitmq.client.AMQP.Exchange.DeclareOk> |
declare(ExchangeSpecification specification,
ResourceManagementOptions options) |
Mono<com.rabbitmq.client.AMQP.Queue.DeclareOk> |
declare(QueueSpecification specification)
Declare a queue following the specification.
|
Mono<com.rabbitmq.client.AMQP.Queue.DeclareOk> |
declare(QueueSpecification specification,
ResourceManagementOptions options)
Declare a queue following the specification and the resource management options.
|
Mono<com.rabbitmq.client.AMQP.Exchange.DeclareOk> |
declareExchange(ExchangeSpecification specification) |
Mono<com.rabbitmq.client.AMQP.Exchange.DeclareOk> |
declareExchange(ExchangeSpecification specification,
ResourceManagementOptions options) |
Mono<com.rabbitmq.client.AMQP.Queue.DeclareOk> |
declareQueue(QueueSpecification specification)
Declare a queue following the specification.
|
Mono<com.rabbitmq.client.AMQP.Queue.DeclareOk> |
declareQueue(QueueSpecification specification,
ResourceManagementOptions options)
Declare a queue following the specification and the resource management options.
|
Mono<com.rabbitmq.client.AMQP.Exchange.DeleteOk> |
delete(ExchangeSpecification specification) |
Mono<com.rabbitmq.client.AMQP.Exchange.DeleteOk> |
delete(ExchangeSpecification specification,
boolean ifUnused) |
Mono<com.rabbitmq.client.AMQP.Exchange.DeleteOk> |
delete(ExchangeSpecification specification,
boolean ifUnused,
ResourceManagementOptions options) |
Mono<com.rabbitmq.client.AMQP.Exchange.DeleteOk> |
delete(ExchangeSpecification specification,
ResourceManagementOptions options) |
Mono<com.rabbitmq.client.AMQP.Queue.DeleteOk> |
delete(QueueSpecification specification) |
Mono<com.rabbitmq.client.AMQP.Queue.DeleteOk> |
delete(QueueSpecification specification,
boolean ifUnused,
boolean ifEmpty) |
Mono<com.rabbitmq.client.AMQP.Queue.DeleteOk> |
delete(QueueSpecification specification,
boolean ifUnused,
boolean ifEmpty,
ResourceManagementOptions options) |
Mono<com.rabbitmq.client.AMQP.Queue.DeleteOk> |
delete(QueueSpecification specification,
ResourceManagementOptions options) |
Mono<com.rabbitmq.client.AMQP.Exchange.DeleteOk> |
deleteExchange(ExchangeSpecification specification,
boolean ifUnused) |
Mono<com.rabbitmq.client.AMQP.Exchange.DeleteOk> |
deleteExchange(ExchangeSpecification specification,
boolean ifUnused,
ResourceManagementOptions options) |
Mono<com.rabbitmq.client.AMQP.Queue.DeleteOk> |
deleteQueue(QueueSpecification specification,
boolean ifUnused,
boolean ifEmpty) |
Mono<com.rabbitmq.client.AMQP.Queue.DeleteOk> |
deleteQueue(QueueSpecification specification,
boolean ifUnused,
boolean ifEmpty,
ResourceManagementOptions options) |
RpcClient |
rpcClient(String exchange,
String routingKey) |
RpcClient |
rpcClient(String exchange,
String routingKey,
Supplier<String> correlationIdProvider) |
Mono<Void> |
send(Publisher<OutboundMessage> messages) |
Mono<Void> |
send(Publisher<OutboundMessage> messages,
SendOptions options) |
Flux<OutboundMessageResult> |
sendWithPublishConfirms(Publisher<OutboundMessage> messages)
Publish a flux of messages and expect confirmations.
|
Flux<OutboundMessageResult> |
sendWithPublishConfirms(Publisher<OutboundMessage> messages,
SendOptions options)
Publish a flux of messages and expect confirmations.
|
<OMSG extends OutboundMessage> |
sendWithTypedPublishConfirms(Publisher<OMSG> messages)
Publish a flux of subclass of
OutboundMessage and expect confirmations. |
<OMSG extends OutboundMessage> |
sendWithTypedPublishConfirms(Publisher<OMSG> messages,
SendOptions options)
Publish a flux of subclass of
OutboundMessage and expect confirmations. |
Mono<com.rabbitmq.client.AMQP.Queue.UnbindOk> |
unbind(BindingSpecification specification)
Unbind a queue from an exchange.
|
Mono<com.rabbitmq.client.AMQP.Queue.UnbindOk> |
unbind(BindingSpecification specification,
ResourceManagementOptions options)
Unbind a queue from an exchange.
|
Mono<com.rabbitmq.client.AMQP.Exchange.UnbindOk> |
unbindExchange(BindingSpecification specification)
Unbind an exchange from another exchange.
|
Mono<com.rabbitmq.client.AMQP.Exchange.UnbindOk> |
unbindExchange(BindingSpecification specification,
ResourceManagementOptions options)
Unbind an exchange from another exchange.
|
Mono<com.rabbitmq.client.AMQP.Queue.UnbindOk> |
unbindQueue(BindingSpecification specification)
Unbind a queue from an exchange.
|
Mono<com.rabbitmq.client.AMQP.Queue.UnbindOk> |
unbindQueue(BindingSpecification specification,
ResourceManagementOptions options)
Unbind a queue from an exchange.
|
public Sender()
public Sender(SenderOptions options)
public Mono<Void> send(Publisher<OutboundMessage> messages)
public Mono<Void> send(Publisher<OutboundMessage> messages, @Nullable SendOptions options)
public Flux<OutboundMessageResult> sendWithPublishConfirms(Publisher<OutboundMessage> messages)
This method uses RabbitMQ Publisher Confirms extension to make sure outbound messages made it or not to the broker.
See sendWithPublishConfirms(Publisher, SendOptions)
to have more control over the publishing
and the confirmations with SendOptions
.
Use sendWithTypedPublishConfirms(Publisher)
to publish instances of a custom OutboundMessage
subclass and get them back in the flux of OutboundMessageResult
.
messages
- flux of outbound messagespublic Flux<OutboundMessageResult> sendWithPublishConfirms(Publisher<OutboundMessage> messages, SendOptions options)
This method uses RabbitMQ Publisher Confirms extension to make sure outbound messages made it or not to the broker.
It is also possible to know if a message has been routed to a least one queue by enabling the mandatory flag. The default is to not use this flag.
Use sendWithTypedPublishConfirms(Publisher, SendOptions)
to publish instances of a custom OutboundMessage
subclass and get them back in the flux of OutboundMessageResult
.
messages
- flux of outbound messagesoptions
- options to configure publishingSendOptions.trackReturned(boolean)
public <OMSG extends OutboundMessage> Flux<OutboundMessageResult<OMSG>> sendWithTypedPublishConfirms(Publisher<OMSG> messages)
OutboundMessage
and expect confirmations.
This method can be interesting compared to sendWithPublishConfirms(Publisher)
when
OutboundMessage
instances of a custom class need to be published and then retrieved
in the OutboundMessageResult
flux. Such a custom class can contain correlation data
useful when dealing with the confirmation. Note the CorrelableOutboundMessage
class is provided
if just an extra property is needed compared to OutboundMessage
.
This method uses RabbitMQ Publisher Confirms extension to make sure outbound messages made it or not to the broker.
See sendWithTypedPublishConfirms(Publisher, SendOptions)
to have more control over the
publishing and the confirmations with SendOptions
.
messages
- flux of outbound messages with typed correlated metadataCorrelableOutboundMessage
public <OMSG extends OutboundMessage> Flux<OutboundMessageResult<OMSG>> sendWithTypedPublishConfirms(Publisher<OMSG> messages, @Nullable SendOptions options)
OutboundMessage
and expect confirmations.
This method can be interesting compared to sendWithPublishConfirms(Publisher)
when
OutboundMessage
instances of a custom class need to be published and then retrieved
in the OutboundMessageResult
flux. Such a custom class can contain correlation data
useful when dealing with the confirmation. Note the CorrelableOutboundMessage
class is provided
if just an extra property is needed compared to OutboundMessage
.
This method uses RabbitMQ Publisher Confirms extension to make sure outbound messages made it or not to the broker.
It is also possible to know if a message has been routed to a least one queue by enabling the mandatory flag. The default is to not use this flag.
messages
- flux of outbound messages with typed correlated metadataoptions
- options to configure publishingSendOptions.trackReturned(boolean)
public RpcClient rpcClient(String exchange, String routingKey, Supplier<String> correlationIdProvider)
public Mono<com.rabbitmq.client.AMQP.Queue.DeclareOk> declare(QueueSpecification specification)
specification
- the specification of the queueQueueSpecification
public Mono<com.rabbitmq.client.AMQP.Queue.DeclareOk> declare(QueueSpecification specification, @Nullable ResourceManagementOptions options)
specification
- the specification of the queueoptions
- options for resource managementQueueSpecification
,
ResourceManagementOptions
public Mono<com.rabbitmq.client.AMQP.Queue.DeclareOk> declareQueue(QueueSpecification specification)
specification
- the specification of the queueQueueSpecification
public Mono<com.rabbitmq.client.AMQP.Queue.DeclareOk> declareQueue(QueueSpecification specification, @Nullable ResourceManagementOptions options)
specification
- the specification of the queueoptions
- options for resource managementQueueSpecification
,
ResourceManagementOptions
public Mono<com.rabbitmq.client.AMQP.Queue.DeleteOk> delete(QueueSpecification specification)
public Mono<com.rabbitmq.client.AMQP.Queue.DeleteOk> delete(QueueSpecification specification, @Nullable ResourceManagementOptions options)
public Mono<com.rabbitmq.client.AMQP.Queue.DeleteOk> delete(QueueSpecification specification, boolean ifUnused, boolean ifEmpty)
public Mono<com.rabbitmq.client.AMQP.Queue.DeleteOk> delete(QueueSpecification specification, boolean ifUnused, boolean ifEmpty, @Nullable ResourceManagementOptions options)
public Mono<com.rabbitmq.client.AMQP.Queue.DeleteOk> deleteQueue(QueueSpecification specification, boolean ifUnused, boolean ifEmpty)
public Mono<com.rabbitmq.client.AMQP.Queue.DeleteOk> deleteQueue(QueueSpecification specification, boolean ifUnused, boolean ifEmpty, @Nullable ResourceManagementOptions options)
public Mono<com.rabbitmq.client.AMQP.Exchange.DeclareOk> declare(ExchangeSpecification specification)
public Mono<com.rabbitmq.client.AMQP.Exchange.DeclareOk> declare(ExchangeSpecification specification, @Nullable ResourceManagementOptions options)
public Mono<com.rabbitmq.client.AMQP.Exchange.DeclareOk> declareExchange(ExchangeSpecification specification)
public Mono<com.rabbitmq.client.AMQP.Exchange.DeclareOk> declareExchange(ExchangeSpecification specification, @Nullable ResourceManagementOptions options)
public Mono<com.rabbitmq.client.AMQP.Exchange.DeleteOk> delete(ExchangeSpecification specification)
public Mono<com.rabbitmq.client.AMQP.Exchange.DeleteOk> delete(ExchangeSpecification specification, @Nullable ResourceManagementOptions options)
public Mono<com.rabbitmq.client.AMQP.Exchange.DeleteOk> delete(ExchangeSpecification specification, boolean ifUnused)
public Mono<com.rabbitmq.client.AMQP.Exchange.DeleteOk> delete(ExchangeSpecification specification, boolean ifUnused, @Nullable ResourceManagementOptions options)
public Mono<com.rabbitmq.client.AMQP.Exchange.DeleteOk> deleteExchange(ExchangeSpecification specification, boolean ifUnused)
public Mono<com.rabbitmq.client.AMQP.Exchange.DeleteOk> deleteExchange(ExchangeSpecification specification, boolean ifUnused, @Nullable ResourceManagementOptions options)
public Mono<com.rabbitmq.client.AMQP.Queue.UnbindOk> unbindQueue(BindingSpecification specification)
Alias of unbind(BindingSpecification)
.
specification
- the unbinding specificationpublic Mono<com.rabbitmq.client.AMQP.Queue.UnbindOk> unbindQueue(BindingSpecification specification, @Nullable ResourceManagementOptions options)
Alias of unbind(BindingSpecification, ResourceManagementOptions)
.
specification
- the unbinding specificationoptions
- options to control the operation, e.g. channel to usepublic Mono<com.rabbitmq.client.AMQP.Queue.UnbindOk> unbind(BindingSpecification specification)
Alias of unbindQueue(BindingSpecification)
.
specification
- the unbinding specificationpublic Mono<com.rabbitmq.client.AMQP.Queue.UnbindOk> unbind(BindingSpecification specification, @Nullable ResourceManagementOptions options)
Alias of unbindQueue(BindingSpecification, ResourceManagementOptions)
.
specification
- the unbinding specificationoptions
- options to control the operation, e.g. channel to usepublic Mono<com.rabbitmq.client.AMQP.Exchange.UnbindOk> unbindExchange(BindingSpecification specification)
specification
- the unbinding specificationpublic Mono<com.rabbitmq.client.AMQP.Exchange.UnbindOk> unbindExchange(BindingSpecification specification, @Nullable ResourceManagementOptions options)
specification
- the unbinding specificationoptions
- options to control the operation, e.g. channel to usepublic Mono<com.rabbitmq.client.AMQP.Queue.BindOk> bindQueue(BindingSpecification specification)
Alias of bind(BindingSpecification)
specification
- the binding specificationpublic Mono<com.rabbitmq.client.AMQP.Queue.BindOk> bindQueue(BindingSpecification specification, @Nullable ResourceManagementOptions options)
Alias of bind(BindingSpecification, ResourceManagementOptions)
specification
- the binding specificationoptions
- options to control the operation, e.g. channel to usepublic Mono<com.rabbitmq.client.AMQP.Queue.BindOk> bind(BindingSpecification specification)
Alias of bindQueue(BindingSpecification)
specification
- the binding specificationpublic Mono<com.rabbitmq.client.AMQP.Queue.BindOk> bind(BindingSpecification specification, @Nullable ResourceManagementOptions options)
Alias of bindQueue(BindingSpecification, ResourceManagementOptions)
specification
- the binding specificationoptions
- options to control the operation, e.g. channel to usepublic Mono<com.rabbitmq.client.AMQP.Exchange.BindOk> bindExchange(BindingSpecification specification)
specification
- the binding specificationpublic Mono<com.rabbitmq.client.AMQP.Exchange.BindOk> bindExchange(BindingSpecification specification, @Nullable ResourceManagementOptions options)
specification
- the binding specificationoptions
- options to control the operation, e.g. channel to usepublic void close()
close
in interface AutoCloseable