io.vertx.rxjava.rabbitmq.RabbitMQClient Maven / Gradle / Ivy
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.rxjava.rabbitmq;
import rx.Observable;
import rx.Single;
import io.vertx.rx.java.RxHelper;
import io.vertx.rx.java.WriteStreamSubscriber;
import io.vertx.rx.java.SingleOnSubscribeAdapter;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.Iterator;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import io.vertx.core.Handler;
import io.vertx.core.AsyncResult;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
import io.vertx.lang.rx.RxGen;
import io.vertx.lang.rx.TypeArg;
import io.vertx.lang.rx.MappingIterator;
/**
*
*
* NOTE: This class has been automatically generated from the {@link io.vertx.rabbitmq.RabbitMQClient original} non RX-ified interface using Vert.x codegen.
*/
@RxGen(io.vertx.rabbitmq.RabbitMQClient.class)
public class RabbitMQClient {
@Override
public String toString() {
return delegate.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RabbitMQClient that = (RabbitMQClient) o;
return delegate.equals(that.delegate);
}
@Override
public int hashCode() {
return delegate.hashCode();
}
public static final TypeArg __TYPE_ARG = new TypeArg<>( obj -> new RabbitMQClient((io.vertx.rabbitmq.RabbitMQClient) obj),
RabbitMQClient::getDelegate
);
private final io.vertx.rabbitmq.RabbitMQClient delegate;
public RabbitMQClient(io.vertx.rabbitmq.RabbitMQClient delegate) {
this.delegate = delegate;
}
public RabbitMQClient(Object delegate) {
this.delegate = (io.vertx.rabbitmq.RabbitMQClient)delegate;
}
public io.vertx.rabbitmq.RabbitMQClient getDelegate() {
return delegate;
}
private static final TypeArg TYPE_ARG_0 = new TypeArg(o1 -> io.vertx.rxjava.rabbitmq.RabbitMQMessage.newInstance((io.vertx.rabbitmq.RabbitMQMessage)o1), o1 -> o1.getDelegate());
private static final TypeArg TYPE_ARG_1 = new TypeArg(o1 -> io.vertx.rxjava.rabbitmq.RabbitMQConsumer.newInstance((io.vertx.rabbitmq.RabbitMQConsumer)o1), o1 -> o1.getDelegate());
private static final TypeArg TYPE_ARG_2 = new TypeArg(o1 -> io.vertx.rxjava.rabbitmq.RabbitMQConsumer.newInstance((io.vertx.rabbitmq.RabbitMQConsumer)o1), o1 -> o1.getDelegate());
private static final TypeArg> TYPE_ARG_3 = new TypeArg>(o1 -> io.vertx.rxjava.core.streams.ReadStream.newInstance((io.vertx.core.streams.ReadStream)o1, TypeArg.unknown()), o1 -> o1.getDelegate());
/**
* Create and return a client configured with the default options.
* @param vertx the vertx instance
* @return the client
*/
public static io.vertx.rxjava.rabbitmq.RabbitMQClient create(io.vertx.rxjava.core.Vertx vertx) {
io.vertx.rxjava.rabbitmq.RabbitMQClient ret = io.vertx.rxjava.rabbitmq.RabbitMQClient.newInstance((io.vertx.rabbitmq.RabbitMQClient)io.vertx.rabbitmq.RabbitMQClient.create(vertx.getDelegate()));
return ret;
}
/**
* Create and return a client.
* @param vertx the vertx instance
* @param config the client config
* @return the client
*/
public static io.vertx.rxjava.rabbitmq.RabbitMQClient create(io.vertx.rxjava.core.Vertx vertx, io.vertx.rabbitmq.RabbitMQOptions config) {
io.vertx.rxjava.rabbitmq.RabbitMQClient ret = io.vertx.rxjava.rabbitmq.RabbitMQClient.newInstance((io.vertx.rabbitmq.RabbitMQClient)io.vertx.rabbitmq.RabbitMQClient.create(vertx.getDelegate(), config));
return ret;
}
/**
* Acknowledge one or several received messages. Supply the deliveryTag from the AMQP.Basic.GetOk or AMQP.Basic.Deliver
* method containing the received message being acknowledged.
* @param deliveryTag
* @param multiple
* @return
*/
public io.vertx.core.Future basicAck(long deliveryTag, boolean multiple) {
io.vertx.core.Future ret = delegate.basicAck(deliveryTag, multiple).map(val -> val);
return ret;
}
/**
* Acknowledge one or several received messages. Supply the deliveryTag from the AMQP.Basic.GetOk or AMQP.Basic.Deliver
* method containing the received message being acknowledged.
* @param deliveryTag
* @param multiple
* @return
*/
public rx.Single rxBasicAck(long deliveryTag, boolean multiple) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.basicAck(deliveryTag, multiple).onComplete(fut);
}));
}
/**
* Reject one or several received messages.
* @param deliveryTag
* @param multiple
* @param requeue
* @return
*/
public io.vertx.core.Future basicNack(long deliveryTag, boolean multiple, boolean requeue) {
io.vertx.core.Future ret = delegate.basicNack(deliveryTag, multiple, requeue).map(val -> val);
return ret;
}
/**
* Reject one or several received messages.
* @param deliveryTag
* @param multiple
* @param requeue
* @return
*/
public rx.Single rxBasicNack(long deliveryTag, boolean multiple, boolean requeue) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.basicNack(deliveryTag, multiple, requeue).onComplete(fut);
}));
}
/**
* Retrieve a message from a queue using AMQP.Basic.Get
* @param queue
* @param autoAck
* @return
*/
public io.vertx.core.Future basicGet(java.lang.String queue, boolean autoAck) {
io.vertx.core.Future ret = delegate.basicGet(queue, autoAck).map(val -> io.vertx.rxjava.rabbitmq.RabbitMQMessage.newInstance((io.vertx.rabbitmq.RabbitMQMessage)val));
return ret;
}
/**
* Retrieve a message from a queue using AMQP.Basic.Get
* @param queue
* @param autoAck
* @return
*/
public rx.Single rxBasicGet(java.lang.String queue, boolean autoAck) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.basicGet(queue, autoAck).onComplete(fut);
}));
}
/**
* @param queue
* @return
*/
public io.vertx.core.Future basicConsumer(java.lang.String queue) {
io.vertx.core.Future ret = delegate.basicConsumer(queue).map(val -> io.vertx.rxjava.rabbitmq.RabbitMQConsumer.newInstance((io.vertx.rabbitmq.RabbitMQConsumer)val));
return ret;
}
/**
* @param queue
* @return
*/
public rx.Single rxBasicConsumer(java.lang.String queue) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.basicConsumer(queue).onComplete(fut);
}));
}
/**
* Create a consumer with the given options
.
* @param queue the name of a queue
* @param options options for queue
* @return
*/
public io.vertx.core.Future basicConsumer(java.lang.String queue, io.vertx.rabbitmq.QueueOptions options) {
io.vertx.core.Future ret = delegate.basicConsumer(queue, options).map(val -> io.vertx.rxjava.rabbitmq.RabbitMQConsumer.newInstance((io.vertx.rabbitmq.RabbitMQConsumer)val));
return ret;
}
/**
* Create a consumer with the given options
.
* @param queue the name of a queue
* @param options options for queue
* @return
*/
public rx.Single rxBasicConsumer(java.lang.String queue, io.vertx.rabbitmq.QueueOptions options) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.basicConsumer(queue, options).onComplete(fut);
}));
}
/**
* Publish a message. Publishing to a non-existent exchange will result in a channel-level protocol exception,
* which closes the channel. Invocations of Channel#basicPublish will eventually block if a resource-driven alarm is in effect.
* @param exchange
* @param routingKey
* @param body
* @return
*/
public io.vertx.core.Future basicPublish(java.lang.String exchange, java.lang.String routingKey, io.vertx.core.buffer.Buffer body) {
io.vertx.core.Future ret = delegate.basicPublish(exchange, routingKey, body).map(val -> val);
return ret;
}
/**
* Publish a message. Publishing to a non-existent exchange will result in a channel-level protocol exception,
* which closes the channel. Invocations of Channel#basicPublish will eventually block if a resource-driven alarm is in effect.
* @param exchange
* @param routingKey
* @param body
* @return
*/
public rx.Single rxBasicPublish(java.lang.String exchange, java.lang.String routingKey, io.vertx.core.buffer.Buffer body) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.basicPublish(exchange, routingKey, body).onComplete(fut);
}));
}
/**
* Add a Confirm Listener to the channel.
* Note that this will automatically call confirmSelect, it is not necessary to call that too.
* @param maxQueueSize maximum size of the queue of confirmations
* @return
*/
public io.vertx.core.Future> addConfirmListener(int maxQueueSize) {
io.vertx.core.Future> ret = delegate.addConfirmListener(maxQueueSize).map(val -> io.vertx.rxjava.core.streams.ReadStream.newInstance((io.vertx.core.streams.ReadStream)val, TypeArg.unknown()));
return ret;
}
/**
* Add a Confirm Listener to the channel.
* Note that this will automatically call confirmSelect, it is not necessary to call that too.
* @param maxQueueSize maximum size of the queue of confirmations
* @return
*/
public rx.Single> rxAddConfirmListener(int maxQueueSize) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.addConfirmListener(maxQueueSize).onComplete(fut);
}));
}
/**
* Enables publisher acknowledgements on this channel. Can be called once during client initialisation. Calls to basicPublish()
* will have to be confirmed.
* @return
*/
public io.vertx.core.Future confirmSelect() {
io.vertx.core.Future ret = delegate.confirmSelect().map(val -> val);
return ret;
}
/**
* Enables publisher acknowledgements on this channel. Can be called once during client initialisation. Calls to basicPublish()
* will have to be confirmed.
* @return
*/
public rx.Single rxConfirmSelect() {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.confirmSelect().onComplete(fut);
}));
}
/**
* Wait until all messages published since the last call have been either ack'd or nack'd by the broker.
* This will incur slight performance loss at the expense of higher write consistency.
* If desired, multiple calls to basicPublish() can be batched before confirming.
* @return
*/
public io.vertx.core.Future waitForConfirms() {
io.vertx.core.Future ret = delegate.waitForConfirms().map(val -> val);
return ret;
}
/**
* Wait until all messages published since the last call have been either ack'd or nack'd by the broker.
* This will incur slight performance loss at the expense of higher write consistency.
* If desired, multiple calls to basicPublish() can be batched before confirming.
* @return
*/
public rx.Single rxWaitForConfirms() {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.waitForConfirms().onComplete(fut);
}));
}
/**
* Wait until all messages published since the last call have been either ack'd or nack'd by the broker; or until timeout elapses. If the timeout expires a TimeoutException is thrown.
* @param timeout
* @return
*/
public io.vertx.core.Future waitForConfirms(long timeout) {
io.vertx.core.Future ret = delegate.waitForConfirms(timeout).map(val -> val);
return ret;
}
/**
* Wait until all messages published since the last call have been either ack'd or nack'd by the broker; or until timeout elapses. If the timeout expires a TimeoutException is thrown.
* @param timeout
* @return
*/
public rx.Single rxWaitForConfirms(long timeout) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.waitForConfirms(timeout).onComplete(fut);
}));
}
/**
* Request a specific prefetchCount "quality of service" settings
* for this channel.
* @param prefetchCount maximum number of messages that the server will deliver, 0 if unlimited
* @return
*/
public io.vertx.core.Future basicQos(int prefetchCount) {
io.vertx.core.Future ret = delegate.basicQos(prefetchCount).map(val -> val);
return ret;
}
/**
* Request a specific prefetchCount "quality of service" settings
* for this channel.
* @param prefetchCount maximum number of messages that the server will deliver, 0 if unlimited
* @return
*/
public rx.Single rxBasicQos(int prefetchCount) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.basicQos(prefetchCount).onComplete(fut);
}));
}
/**
* Request a specific prefetchCount "quality of service" settings
* for this channel.
* @param prefetchCount maximum number of messages that the server will deliver, 0 if unlimited
* @param global true if the settings should be applied to the entire channel rather than each consumer
* @return
*/
public io.vertx.core.Future basicQos(int prefetchCount, boolean global) {
io.vertx.core.Future ret = delegate.basicQos(prefetchCount, global).map(val -> val);
return ret;
}
/**
* Request a specific prefetchCount "quality of service" settings
* for this channel.
* @param prefetchCount maximum number of messages that the server will deliver, 0 if unlimited
* @param global true if the settings should be applied to the entire channel rather than each consumer
* @return
*/
public rx.Single rxBasicQos(int prefetchCount, boolean global) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.basicQos(prefetchCount, global).onComplete(fut);
}));
}
/**
* Request specific "quality of service" settings.
*
* These settings impose limits on the amount of data the server
* will deliver to consumers before requiring acknowledgements.
* Thus they provide a means of consumer-initiated flow control.
* @param prefetchSize maximum amount of content (measured in octets) that the server will deliver, 0 if unlimited
* @param prefetchCount maximum number of messages that the server will deliver, 0 if unlimited
* @param global true if the settings should be applied to the entire channel rather than each consumer
* @return
*/
public io.vertx.core.Future basicQos(int prefetchSize, int prefetchCount, boolean global) {
io.vertx.core.Future ret = delegate.basicQos(prefetchSize, prefetchCount, global).map(val -> val);
return ret;
}
/**
* Request specific "quality of service" settings.
*
* These settings impose limits on the amount of data the server
* will deliver to consumers before requiring acknowledgements.
* Thus they provide a means of consumer-initiated flow control.
* @param prefetchSize maximum amount of content (measured in octets) that the server will deliver, 0 if unlimited
* @param prefetchCount maximum number of messages that the server will deliver, 0 if unlimited
* @param global true if the settings should be applied to the entire channel rather than each consumer
* @return
*/
public rx.Single rxBasicQos(int prefetchSize, int prefetchCount, boolean global) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.basicQos(prefetchSize, prefetchCount, global).onComplete(fut);
}));
}
/**
* Declare an exchange.
* @param exchange
* @param type
* @param durable
* @param autoDelete
* @return
*/
public io.vertx.core.Future exchangeDeclare(java.lang.String exchange, java.lang.String type, boolean durable, boolean autoDelete) {
io.vertx.core.Future ret = delegate.exchangeDeclare(exchange, type, durable, autoDelete).map(val -> val);
return ret;
}
/**
* Declare an exchange.
* @param exchange
* @param type
* @param durable
* @param autoDelete
* @return
*/
public rx.Single rxExchangeDeclare(java.lang.String exchange, java.lang.String type, boolean durable, boolean autoDelete) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.exchangeDeclare(exchange, type, durable, autoDelete).onComplete(fut);
}));
}
/**
* Declare an exchange with additional parameters such as dead lettering, an alternate exchange or TTL.
* @param exchange
* @param type
* @param durable
* @param autoDelete
* @param config
* @return
*/
public io.vertx.core.Future exchangeDeclare(java.lang.String exchange, java.lang.String type, boolean durable, boolean autoDelete, io.vertx.core.json.JsonObject config) {
io.vertx.core.Future ret = delegate.exchangeDeclare(exchange, type, durable, autoDelete, config).map(val -> val);
return ret;
}
/**
* Declare an exchange with additional parameters such as dead lettering, an alternate exchange or TTL.
* @param exchange
* @param type
* @param durable
* @param autoDelete
* @param config
* @return
*/
public rx.Single rxExchangeDeclare(java.lang.String exchange, java.lang.String type, boolean durable, boolean autoDelete, io.vertx.core.json.JsonObject config) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.exchangeDeclare(exchange, type, durable, autoDelete, config).onComplete(fut);
}));
}
/**
* Delete an exchange, without regard for whether it is in use or not.
* @param exchange
* @return
*/
public io.vertx.core.Future exchangeDelete(java.lang.String exchange) {
io.vertx.core.Future ret = delegate.exchangeDelete(exchange).map(val -> val);
return ret;
}
/**
* Delete an exchange, without regard for whether it is in use or not.
* @param exchange
* @return
*/
public rx.Single rxExchangeDelete(java.lang.String exchange) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.exchangeDelete(exchange).onComplete(fut);
}));
}
/**
* Bind an exchange to an exchange.
* @param destination
* @param source
* @param routingKey
* @return
*/
public io.vertx.core.Future exchangeBind(java.lang.String destination, java.lang.String source, java.lang.String routingKey) {
io.vertx.core.Future ret = delegate.exchangeBind(destination, source, routingKey).map(val -> val);
return ret;
}
/**
* Bind an exchange to an exchange.
* @param destination
* @param source
* @param routingKey
* @return
*/
public rx.Single rxExchangeBind(java.lang.String destination, java.lang.String source, java.lang.String routingKey) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.exchangeBind(destination, source, routingKey).onComplete(fut);
}));
}
/**
* Bind an exchange to an exchange.
* @param destination
* @param source
* @param routingKey
* @param arguments
* @return
*/
public io.vertx.core.Future exchangeBind(java.lang.String destination, java.lang.String source, java.lang.String routingKey, java.util.Map arguments) {
io.vertx.core.Future ret = delegate.exchangeBind(destination, source, routingKey, arguments).map(val -> val);
return ret;
}
/**
* Bind an exchange to an exchange.
* @param destination
* @param source
* @param routingKey
* @param arguments
* @return
*/
public rx.Single rxExchangeBind(java.lang.String destination, java.lang.String source, java.lang.String routingKey, java.util.Map arguments) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.exchangeBind(destination, source, routingKey, arguments).onComplete(fut);
}));
}
/**
* Unbind an exchange from an exchange.
* @param destination
* @param source
* @param routingKey
* @return
*/
public io.vertx.core.Future exchangeUnbind(java.lang.String destination, java.lang.String source, java.lang.String routingKey) {
io.vertx.core.Future ret = delegate.exchangeUnbind(destination, source, routingKey).map(val -> val);
return ret;
}
/**
* Unbind an exchange from an exchange.
* @param destination
* @param source
* @param routingKey
* @return
*/
public rx.Single rxExchangeUnbind(java.lang.String destination, java.lang.String source, java.lang.String routingKey) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.exchangeUnbind(destination, source, routingKey).onComplete(fut);
}));
}
/**
* Unbind an exchange from an exchange.
* @param destination
* @param source
* @param routingKey
* @param arguments
* @return
*/
public io.vertx.core.Future exchangeUnbind(java.lang.String destination, java.lang.String source, java.lang.String routingKey, java.util.Map arguments) {
io.vertx.core.Future ret = delegate.exchangeUnbind(destination, source, routingKey, arguments).map(val -> val);
return ret;
}
/**
* Unbind an exchange from an exchange.
* @param destination
* @param source
* @param routingKey
* @param arguments
* @return
*/
public rx.Single rxExchangeUnbind(java.lang.String destination, java.lang.String source, java.lang.String routingKey, java.util.Map arguments) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.exchangeUnbind(destination, source, routingKey, arguments).onComplete(fut);
}));
}
/**
* Actively declare a server-named exclusive, autodelete, non-durable queue.
* @return
*/
public io.vertx.core.Future queueDeclareAuto() {
io.vertx.core.Future ret = delegate.queueDeclareAuto().map(val -> val);
return ret;
}
/**
* Actively declare a server-named exclusive, autodelete, non-durable queue.
* @return
*/
public rx.Single rxQueueDeclareAuto() {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.queueDeclareAuto().onComplete(fut);
}));
}
/**
* Bind a queue to an exchange
* @param queue
* @param exchange
* @param routingKey
* @return
*/
public io.vertx.core.Future queueBind(java.lang.String queue, java.lang.String exchange, java.lang.String routingKey) {
io.vertx.core.Future ret = delegate.queueBind(queue, exchange, routingKey).map(val -> val);
return ret;
}
/**
* Bind a queue to an exchange
* @param queue
* @param exchange
* @param routingKey
* @return
*/
public rx.Single rxQueueBind(java.lang.String queue, java.lang.String exchange, java.lang.String routingKey) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.queueBind(queue, exchange, routingKey).onComplete(fut);
}));
}
/**
* Bind a queue to an exchange
* @param queue
* @param exchange
* @param routingKey
* @param arguments
* @return
*/
public io.vertx.core.Future queueBind(java.lang.String queue, java.lang.String exchange, java.lang.String routingKey, java.util.Map arguments) {
io.vertx.core.Future ret = delegate.queueBind(queue, exchange, routingKey, arguments).map(val -> val);
return ret;
}
/**
* Bind a queue to an exchange
* @param queue
* @param exchange
* @param routingKey
* @param arguments
* @return
*/
public rx.Single rxQueueBind(java.lang.String queue, java.lang.String exchange, java.lang.String routingKey, java.util.Map arguments) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.queueBind(queue, exchange, routingKey, arguments).onComplete(fut);
}));
}
/**
* Unbind a queue from an exchange
* @param queue
* @param exchange
* @param routingKey
* @return
*/
public io.vertx.core.Future queueUnbind(java.lang.String queue, java.lang.String exchange, java.lang.String routingKey) {
io.vertx.core.Future ret = delegate.queueUnbind(queue, exchange, routingKey).map(val -> val);
return ret;
}
/**
* Unbind a queue from an exchange
* @param queue
* @param exchange
* @param routingKey
* @return
*/
public rx.Single rxQueueUnbind(java.lang.String queue, java.lang.String exchange, java.lang.String routingKey) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.queueUnbind(queue, exchange, routingKey).onComplete(fut);
}));
}
/**
* Unbind a queue from an exchange
* @param queue
* @param exchange
* @param routingKey
* @param arguments
* @return
*/
public io.vertx.core.Future queueUnbind(java.lang.String queue, java.lang.String exchange, java.lang.String routingKey, java.util.Map arguments) {
io.vertx.core.Future ret = delegate.queueUnbind(queue, exchange, routingKey, arguments).map(val -> val);
return ret;
}
/**
* Unbind a queue from an exchange
* @param queue
* @param exchange
* @param routingKey
* @param arguments
* @return
*/
public rx.Single rxQueueUnbind(java.lang.String queue, java.lang.String exchange, java.lang.String routingKey, java.util.Map arguments) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.queueUnbind(queue, exchange, routingKey, arguments).onComplete(fut);
}));
}
/**
* Returns the number of messages in a queue ready to be delivered.
* @param queue
* @return
*/
public io.vertx.core.Future messageCount(java.lang.String queue) {
io.vertx.core.Future ret = delegate.messageCount(queue).map(val -> val);
return ret;
}
/**
* Returns the number of messages in a queue ready to be delivered.
* @param queue
* @return
*/
public rx.Single rxMessageCount(java.lang.String queue) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.messageCount(queue).onComplete(fut);
}));
}
/**
* Start the rabbitMQ client. Create the connection and the channel.
* @return
*/
public io.vertx.core.Future start() {
io.vertx.core.Future ret = delegate.start().map(val -> val);
return ret;
}
/**
* Start the rabbitMQ client. Create the connection and the channel.
* @return
*/
public rx.Single rxStart() {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.start().onComplete(fut);
}));
}
/**
* Stop the rabbitMQ client. Close the connection and its channel.
* @return
*/
public io.vertx.core.Future stop() {
io.vertx.core.Future ret = delegate.stop().map(val -> val);
return ret;
}
/**
* Stop the rabbitMQ client. Close the connection and its channel.
* @return
*/
public rx.Single rxStop() {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.stop().onComplete(fut);
}));
}
/**
* Check if a connection is open
* @return true when the connection is open, false otherwise
*/
public boolean isConnected() {
boolean ret = delegate.isConnected();
return ret;
}
/**
* restart the rabbitMQ connect.
* @param attempts number of attempts
* @return a future notified when the operation is done with a result of the operation
*/
public io.vertx.core.Future restartConnect(int attempts) {
io.vertx.core.Future ret = delegate.restartConnect(attempts).map(val -> val);
return ret;
}
/**
* restart the rabbitMQ connect.
* @param attempts number of attempts
* @return a future notified when the operation is done with a result of the operation
*/
public rx.Single rxRestartConnect(int attempts) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.restartConnect(attempts).onComplete(fut);
}));
}
/**
* Check if a channel is open
* @return true when the connection is open, false otherwise
*/
public boolean isOpenChannel() {
boolean ret = delegate.isOpenChannel();
return ret;
}
/**
* Publish a message. Publishing to a non-existent exchange will result in a channel-level protocol exception,
* which closes the channel. Invocations of Channel#basicPublish will eventually block if a resource-driven alarm is in effect.
* @param exchange
* @param routingKey
* @param properties
* @param body
* @return
*/
public io.vertx.core.Future basicPublish(java.lang.String exchange, java.lang.String routingKey, com.rabbitmq.client.BasicProperties properties, io.vertx.core.buffer.Buffer body) {
io.vertx.core.Future ret = delegate.basicPublish(exchange, routingKey, properties, body).map(val -> val);
return ret;
}
/**
* Publish a message. Publishing to a non-existent exchange will result in a channel-level protocol exception,
* which closes the channel. Invocations of Channel#basicPublish will eventually block if a resource-driven alarm is in effect.
* @param exchange
* @param routingKey
* @param properties
* @param body
* @return
*/
public rx.Single rxBasicPublish(java.lang.String exchange, java.lang.String routingKey, com.rabbitmq.client.BasicProperties properties, io.vertx.core.buffer.Buffer body) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.basicPublish(exchange, routingKey, properties, body).onComplete(fut);
}));
}
/**
* Publish a message. Publishing to a non-existent exchange will result in a channel-level protocol exception,
* which closes the channel. Invocations of Channel#basicPublish will eventually block if a resource-driven alarm is in effect.
*
* The deliveryTagHandler will be called before the message is sent, which is necessary because the confirmation may arrive
* asynchronously before the resultHandler is called.
* @param exchange
* @param routingKey
* @param properties
* @param body
* @param deliveryTagHandler callback to capture the deliveryTag for this message. Note that this will be called synchronously in the context of the client before the result is known.
* @return
*/
public io.vertx.core.Future basicPublishWithDeliveryTag(java.lang.String exchange, java.lang.String routingKey, com.rabbitmq.client.BasicProperties properties, io.vertx.core.buffer.Buffer body, io.vertx.core.Handler deliveryTagHandler) {
io.vertx.core.Future ret = delegate.basicPublishWithDeliveryTag(exchange, routingKey, properties, body, deliveryTagHandler).map(val -> val);
return ret;
}
/**
* Publish a message. Publishing to a non-existent exchange will result in a channel-level protocol exception,
* which closes the channel. Invocations of Channel#basicPublish will eventually block if a resource-driven alarm is in effect.
*
* The deliveryTagHandler will be called before the message is sent, which is necessary because the confirmation may arrive
* asynchronously before the resultHandler is called.
* @param exchange
* @param routingKey
* @param properties
* @param body
* @param deliveryTagHandler callback to capture the deliveryTag for this message. Note that this will be called synchronously in the context of the client before the result is known.
* @return
*/
public rx.Single rxBasicPublishWithDeliveryTag(java.lang.String exchange, java.lang.String routingKey, com.rabbitmq.client.BasicProperties properties, io.vertx.core.buffer.Buffer body, io.vertx.core.Handler deliveryTagHandler) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.basicPublishWithDeliveryTag(exchange, routingKey, properties, body, deliveryTagHandler).onComplete(fut);
}));
}
/**
* Declare a queue
* @param queue
* @param durable
* @param exclusive
* @param autoDelete
* @return
*/
public io.vertx.core.Future queueDeclare(java.lang.String queue, boolean durable, boolean exclusive, boolean autoDelete) {
io.vertx.core.Future ret = delegate.queueDeclare(queue, durable, exclusive, autoDelete).map(val -> val);
return ret;
}
/**
* Declare a queue
* @param queue
* @param durable
* @param exclusive
* @param autoDelete
* @return
*/
public rx.Single rxQueueDeclare(java.lang.String queue, boolean durable, boolean exclusive, boolean autoDelete) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.queueDeclare(queue, durable, exclusive, autoDelete).onComplete(fut);
}));
}
/**
* Declare a queue with config options
* @param queue
* @param durable
* @param exclusive
* @param autoDelete
* @param config
* @return
*/
public io.vertx.core.Future queueDeclare(java.lang.String queue, boolean durable, boolean exclusive, boolean autoDelete, io.vertx.core.json.JsonObject config) {
io.vertx.core.Future ret = delegate.queueDeclare(queue, durable, exclusive, autoDelete, config).map(val -> val);
return ret;
}
/**
* Declare a queue with config options
* @param queue
* @param durable
* @param exclusive
* @param autoDelete
* @param config
* @return
*/
public rx.Single rxQueueDeclare(java.lang.String queue, boolean durable, boolean exclusive, boolean autoDelete, io.vertx.core.json.JsonObject config) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.queueDeclare(queue, durable, exclusive, autoDelete, config).onComplete(fut);
}));
}
/**
* Delete a queue, without regard for whether it is in use or has messages on it
* @param queue
* @return
*/
public io.vertx.core.Future queueDelete(java.lang.String queue) {
io.vertx.core.Future ret = delegate.queueDelete(queue).map(val -> val);
return ret;
}
/**
* Delete a queue, without regard for whether it is in use or has messages on it
* @param queue
* @return
*/
public rx.Single rxQueueDelete(java.lang.String queue) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.queueDelete(queue).onComplete(fut);
}));
}
/**
* Delete a queue
* @param queue
* @param ifUnused
* @param ifEmpty
* @return
*/
public io.vertx.core.Future queueDeleteIf(java.lang.String queue, boolean ifUnused, boolean ifEmpty) {
io.vertx.core.Future ret = delegate.queueDeleteIf(queue, ifUnused, ifEmpty).map(val -> val);
return ret;
}
/**
* Delete a queue
* @param queue
* @param ifUnused
* @param ifEmpty
* @return
*/
public rx.Single rxQueueDeleteIf(java.lang.String queue, boolean ifUnused, boolean ifEmpty) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.queueDeleteIf(queue, ifUnused, ifEmpty).onComplete(fut);
}));
}
public static RabbitMQClient newInstance(io.vertx.rabbitmq.RabbitMQClient arg) {
return arg != null ? new RabbitMQClient(arg) : null;
}
}