Class AmqpConnection
- java.lang.Object
-
- io.vertx.rxjava.amqp.AmqpConnection
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<AmqpConnection>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description AmqpConnection(AmqpConnection delegate)AmqpConnection(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AmqpConnectionclose()Closes the AMQP connection, i.e.AmqpConnectionclose(Handler<AsyncResult<Void>> done)Closes the AMQP connection, i.e.Future<Void>closeFuture()AmqpConnectioncreateAnonymousSender()Creates an anonymous sender.AmqpConnectioncreateAnonymousSender(Handler<AsyncResult<AmqpSender>> completionHandler)Creates an anonymous sender.AmqpConnectioncreateDynamicReceiver()Creates a dynamic receiver.AmqpConnectioncreateDynamicReceiver(Handler<AsyncResult<AmqpReceiver>> completionHandler)Creates a dynamic receiver.AmqpConnectioncreateReceiver(String address)Creates a receiver used to consume messages from the given address.AmqpConnectioncreateReceiver(String address, AmqpReceiverOptions receiverOptions)Creates a receiver used to consumer messages from the given address.AmqpConnectioncreateReceiver(String address, AmqpReceiverOptions receiverOptions, Handler<AsyncResult<AmqpReceiver>> completionHandler)Creates a receiver used to consumer messages from the given address.AmqpConnectioncreateReceiver(String address, Handler<AsyncResult<AmqpReceiver>> completionHandler)Creates a receiver used to consume messages from the given address.AmqpConnectioncreateSender(String address)Creates a sender used to send messages to the given address.AmqpConnectioncreateSender(String address, AmqpSenderOptions options)Creates a sender used to send messages to the given address.AmqpConnectioncreateSender(String address, AmqpSenderOptions options, Handler<AsyncResult<AmqpSender>> completionHandler)Creates a sender used to send messages to the given address.AmqpConnectioncreateSender(String address, Handler<AsyncResult<AmqpSender>> completionHandler)Creates a sender used to send messages to the given address.booleanequals(Object o)AmqpConnectionexceptionHandler(Handler<Throwable> handler)Registers a handler called on disconnection.AmqpConnectiongetDelegate()inthashCode()booleanisDisconnected()static AmqpConnectionnewInstance(AmqpConnection arg)rx.Single<Void>rxClose()Closes the AMQP connection, i.e.rx.Single<AmqpSender>rxCreateAnonymousSender()Creates an anonymous sender.rx.Single<AmqpReceiver>rxCreateDynamicReceiver()Creates a dynamic receiver.rx.Single<AmqpReceiver>rxCreateReceiver(String address)Creates a receiver used to consume messages from the given address.rx.Single<AmqpReceiver>rxCreateReceiver(String address, AmqpReceiverOptions receiverOptions)Creates a receiver used to consumer messages from the given address.rx.Single<AmqpSender>rxCreateSender(String address)Creates a sender used to send messages to the given address.rx.Single<AmqpSender>rxCreateSender(String address, AmqpSenderOptions options)Creates a sender used to send messages to the given address.StringtoString()io.vertx.proton.ProtonConnectionunwrap()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<AmqpConnection> __TYPE_ARG
-
-
Constructor Detail
-
AmqpConnection
public AmqpConnection(AmqpConnection delegate)
-
AmqpConnection
public AmqpConnection(Object delegate)
-
-
Method Detail
-
getDelegate
public AmqpConnection getDelegate()
-
exceptionHandler
public AmqpConnection exceptionHandler(Handler<Throwable> handler)
Registers a handler called on disconnection.- Parameters:
handler- the exception handler.- Returns:
- the connection
-
close
public AmqpConnection close(Handler<AsyncResult<Void>> done)
Closes the AMQP connection, i.e. allows the Close frame to be emitted.- Parameters:
done- the close handler notified when the connection is closed. May benull.- Returns:
- the connection
-
close
public AmqpConnection close()
Closes the AMQP connection, i.e. allows the Close frame to be emitted.- Returns:
- the connection
-
rxClose
public rx.Single<Void> rxClose()
Closes the AMQP connection, i.e. allows the Close frame to be emitted.- Returns:
- the connection
-
createReceiver
public AmqpConnection createReceiver(String address, Handler<AsyncResult<AmqpReceiver>> completionHandler)
Creates a receiver used to consume messages from the given address. The receiver has no handler and won't start receiving messages until a handler is explicitly configured.- Parameters:
address- The source address to attach the consumer to, must not benullcompletionHandler- the handler called with the receiver. The receiver has been opened.- Returns:
- the connection.
-
createReceiver
public AmqpConnection createReceiver(String address)
Creates a receiver used to consume messages from the given address. The receiver has no handler and won't start receiving messages until a handler is explicitly configured.- Parameters:
address- The source address to attach the consumer to, must not benull- Returns:
- the connection.
-
rxCreateReceiver
public rx.Single<AmqpReceiver> rxCreateReceiver(String address)
Creates a receiver used to consume messages from the given address. The receiver has no handler and won't start receiving messages until a handler is explicitly configured.- Parameters:
address- The source address to attach the consumer to, must not benull- Returns:
- the connection.
-
createReceiver
public AmqpConnection createReceiver(String address, AmqpReceiverOptions receiverOptions, Handler<AsyncResult<AmqpReceiver>> completionHandler)
Creates a receiver used to consumer messages from the given address.- Parameters:
address- The source address to attach the consumer to.receiverOptions- The options for this receiver.completionHandler- The handler called with the receiver, once opened. Note that themessageHandlercan be called before thecompletionHandlerif messages are awaiting delivery.- Returns:
- the connection.
-
createReceiver
public AmqpConnection createReceiver(String address, AmqpReceiverOptions receiverOptions)
Creates a receiver used to consumer messages from the given address.- Parameters:
address- The source address to attach the consumer to.receiverOptions- The options for this receiver.- Returns:
- the connection.
-
rxCreateReceiver
public rx.Single<AmqpReceiver> rxCreateReceiver(String address, AmqpReceiverOptions receiverOptions)
Creates a receiver used to consumer messages from the given address.- Parameters:
address- The source address to attach the consumer to.receiverOptions- The options for this receiver.- Returns:
- the connection.
-
createDynamicReceiver
public AmqpConnection createDynamicReceiver(Handler<AsyncResult<AmqpReceiver>> completionHandler)
Creates a dynamic receiver. The address is provided by the broker and is available in thecompletionHandler, using theAmqpReceiver.address()method. this method is useful for request-reply to generate a unique reply address.- Parameters:
completionHandler- the completion handler, called when the receiver has been created and opened.- Returns:
- the connection.
-
createDynamicReceiver
public AmqpConnection createDynamicReceiver()
Creates a dynamic receiver. The address is provided by the broker and is available in thecompletionHandler, using theAmqpReceiver.address()method. this method is useful for request-reply to generate a unique reply address.- Returns:
- the connection.
-
rxCreateDynamicReceiver
public rx.Single<AmqpReceiver> rxCreateDynamicReceiver()
Creates a dynamic receiver. The address is provided by the broker and is available in thecompletionHandler, using theAmqpReceiver.address()method. this method is useful for request-reply to generate a unique reply address.- Returns:
- the connection.
-
createSender
public AmqpConnection createSender(String address, Handler<AsyncResult<AmqpSender>> completionHandler)
Creates a sender used to send messages to the given address. The address must be set. For anonymous sender, checkcreateAnonymousSender(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.amqp.AmqpSender>>).- Parameters:
address- The target address to attach to, must not benullcompletionHandler- The handler called with the sender, once opened- Returns:
- the connection.
-
createSender
public AmqpConnection createSender(String address)
Creates a sender used to send messages to the given address. The address must be set. For anonymous sender, checkcreateAnonymousSender(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.amqp.AmqpSender>>).- Parameters:
address- The target address to attach to, must not benull- Returns:
- the connection.
-
rxCreateSender
public rx.Single<AmqpSender> rxCreateSender(String address)
Creates a sender used to send messages to the given address. The address must be set. For anonymous sender, checkcreateAnonymousSender(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.amqp.AmqpSender>>).- Parameters:
address- The target address to attach to, must not benull- Returns:
- the connection.
-
createSender
public AmqpConnection createSender(String address, AmqpSenderOptions options, Handler<AsyncResult<AmqpSender>> completionHandler)
Creates a sender used to send messages to the given address. The address must be set. For anonymous sender, checkcreateAnonymousSender(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.amqp.AmqpSender>>).- Parameters:
address- The target address to attach to, allowed to benullif theoptionsconfigures the sender to be attached to a dynamic address (provided by the broker).options- The AMQP sender optionscompletionHandler- The handler called with the sender, once opened- Returns:
- the connection.
-
createSender
public AmqpConnection createSender(String address, AmqpSenderOptions options)
Creates a sender used to send messages to the given address. The address must be set. For anonymous sender, checkcreateAnonymousSender(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.amqp.AmqpSender>>).- Parameters:
address- The target address to attach to, allowed to benullif theoptionsconfigures the sender to be attached to a dynamic address (provided by the broker).options- The AMQP sender options- Returns:
- the connection.
-
rxCreateSender
public rx.Single<AmqpSender> rxCreateSender(String address, AmqpSenderOptions options)
Creates a sender used to send messages to the given address. The address must be set. For anonymous sender, checkcreateAnonymousSender(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.amqp.AmqpSender>>).- Parameters:
address- The target address to attach to, allowed to benullif theoptionsconfigures the sender to be attached to a dynamic address (provided by the broker).options- The AMQP sender options- Returns:
- the connection.
-
createAnonymousSender
public AmqpConnection createAnonymousSender(Handler<AsyncResult<AmqpSender>> completionHandler)
Creates an anonymous sender.Unlike "regular" sender, this sender is not associated to a specific address, and each message sent must provide an address. This method can be used in request-reply scenarios where you create a sender to send the reply, but you don't know the address, as the reply address is passed into the message you are going to receive.
- Parameters:
completionHandler- The handler called with the created sender, once opened- Returns:
- the connection.
-
createAnonymousSender
public AmqpConnection createAnonymousSender()
Creates an anonymous sender.Unlike "regular" sender, this sender is not associated to a specific address, and each message sent must provide an address. This method can be used in request-reply scenarios where you create a sender to send the reply, but you don't know the address, as the reply address is passed into the message you are going to receive.
- Returns:
- the connection.
-
rxCreateAnonymousSender
public rx.Single<AmqpSender> rxCreateAnonymousSender()
Creates an anonymous sender.Unlike "regular" sender, this sender is not associated to a specific address, and each message sent must provide an address. This method can be used in request-reply scenarios where you create a sender to send the reply, but you don't know the address, as the reply address is passed into the message you are going to receive.
- Returns:
- the connection.
-
isDisconnected
public boolean isDisconnected()
- Returns:
- whether the connection has been disconnected.
-
closeFuture
public Future<Void> closeFuture()
- Returns:
- a future completed when the connection is closed
-
unwrap
public io.vertx.proton.ProtonConnection unwrap()
- Returns:
- the underlying ProtonConnection.
-
newInstance
public static AmqpConnection newInstance(AmqpConnection arg)
-
-