Class: VertxRabbitmq::RabbitMQClient
- Inherits:
-
Object
- Object
- VertxRabbitmq::RabbitMQClient
- Defined in:
- /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb
Overview
@author Nick Scavelli
Class Method Summary (collapse)
Instance Method Summary (collapse)
-
- (void) basic_ack(deliveryTag = nil, multiple = nil) { ... }
Acknowledge one or several received messages.
-
- (void) basic_consume(queue = nil, address = nil, autoAck = nil) { ... }
Start a non-nolocal, non-exclusive consumer, with a server-generated consumerTag.
-
- (void) basic_get(queue = nil, autoAck = nil) { ... }
Retrieve a message from a queue using AMQP.Basic.Get.
-
- (void) basic_nack(deliveryTag = nil, multiple = nil, requeue = nil) { ... }
Reject one or several received messages.
-
- (void) basic_publish(exchange = nil, routingKey = nil, message = nil) { ... }
Publish a message.
-
- (void) basic_qos(prefetchCount = nil) { ... }
Request specific "quality of service" settings, Limiting the number of unacknowledged messages on a channel (or connection).
-
- (true, false) connected?
Check if a connection is open.
-
- (void) exchange_bind(destination = nil, source = nil, routingKey = nil) { ... }
Bind an exchange to an exchange.
-
- (void) exchange_declare(exchange = nil, type = nil, durable = nil, autoDelete = nil) { ... }
Declare an exchange.
-
- (void) exchange_delete(exchange = nil) { ... }
Delete an exchange, without regard for whether it is in use or not.
-
- (void) exchange_unbind(destination = nil, source = nil, routingKey = nil) { ... }
Unbind an exchange from an exchange.
-
- (void) message_count(queue = nil) { ... }
Returns the number of messages in a queue ready to be delivered.
-
- (true, false) open_channel?
Check if a channel is open.
-
- (void) queue_bind(queue = nil, exchange = nil, routingKey = nil) { ... }
Bind a queue to an exchange.
-
- (void) queue_declare(queue = nil, durable = nil, exclusive = nil, autoDelete = nil) { ... }
Declare a queue.
-
- (void) queue_declare_auto { ... }
Actively declare a server-named exclusive, autodelete, non-durable queue.
-
- (void) queue_delete(queue = nil) { ... }
Delete a queue, without regard for whether it is in use or has messages on it.
-
- (void) queue_delete_if(queue = nil, ifUnused = nil, ifEmpty = nil) { ... }
Delete a queue.
-
- (void) start { ... }
Start the rabbitMQ client.
-
- (void) stop { ... }
Stop the rabbitMQ client.
Class Method Details
+ (::VertxRabbitmq::RabbitMQClient) create(vertx = nil, config = nil)
20 21 22 23 24 25 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 20 def self.create(vertx=nil,config=nil) if vertx.class.method_defined?(:j_del) && config.class == Hash && !block_given? return ::Vertx::Util::Utils.safe_create(Java::IoVertxRabbitmq::RabbitMQClient.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(vertx.j_del,::Vertx::Util::Utils.to_json_object(config)),::VertxRabbitmq::RabbitMQClient) end raise ArgumentError, "Invalid arguments when calling create(vertx,config)" end |
Instance Method Details
- (void) basic_ack(deliveryTag = nil, multiple = nil) { ... }
This method returns an undefined value.
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.
32 33 34 35 36 37 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 32 def basic_ack(deliveryTag=nil,multiple=nil) if deliveryTag.class == Fixnum && (multiple.class == TrueClass || multiple.class == FalseClass) && block_given? return @j_del.java_method(:basicAck, [Java::long.java_class,Java::boolean.java_class,Java::IoVertxCore::Handler.java_class]).call(deliveryTag,multiple,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) })) end raise ArgumentError, "Invalid arguments when calling basic_ack(deliveryTag,multiple)" end |
- (void) basic_consume(queue = nil, address = nil, autoAck = nil) { ... }
This method returns an undefined value.
Start a non-nolocal, non-exclusive consumer, with a server-generated consumerTag.
67 68 69 70 71 72 73 74 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 67 def basic_consume(queue=nil,address=nil,autoAck=nil) if queue.class == String && address.class == String && block_given? && autoAck == nil return @j_del.java_method(:basicConsume, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(queue,address,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) elsif queue.class == String && address.class == String && (autoAck.class == TrueClass || autoAck.class == FalseClass) && block_given? return @j_del.java_method(:basicConsume, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::boolean.java_class,Java::IoVertxCore::Handler.java_class]).call(queue,address,autoAck,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) end raise ArgumentError, "Invalid arguments when calling basic_consume(queue,address,autoAck)" end |
- (void) basic_get(queue = nil, autoAck = nil) { ... }
This method returns an undefined value.
Retrieve a message from a queue using AMQP.Basic.Get
55 56 57 58 59 60 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 55 def basic_get(queue=nil,autoAck=nil) if queue.class == String && (autoAck.class == TrueClass || autoAck.class == FalseClass) && block_given? return @j_del.java_method(:basicGet, [Java::java.lang.String.java_class,Java::boolean.java_class,Java::IoVertxCore::Handler.java_class]).call(queue,autoAck,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) })) end raise ArgumentError, "Invalid arguments when calling basic_get(queue,autoAck)" end |
- (void) basic_nack(deliveryTag = nil, multiple = nil, requeue = nil) { ... }
This method returns an undefined value.
Reject one or several received messages.
44 45 46 47 48 49 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 44 def basic_nack(deliveryTag=nil,multiple=nil,requeue=nil) if deliveryTag.class == Fixnum && (multiple.class == TrueClass || multiple.class == FalseClass) && (requeue.class == TrueClass || requeue.class == FalseClass) && block_given? return @j_del.java_method(:basicNack, [Java::long.java_class,Java::boolean.java_class,Java::boolean.java_class,Java::IoVertxCore::Handler.java_class]).call(deliveryTag,multiple,requeue,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) })) end raise ArgumentError, "Invalid arguments when calling basic_nack(deliveryTag,multiple,requeue)" end |
- (void) basic_publish(exchange = nil, routingKey = nil, message = nil) { ... }
This method returns an undefined value.
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.
82 83 84 85 86 87 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 82 def basic_publish(exchange=nil,routingKey=nil,=nil) if exchange.class == String && routingKey.class == String && .class == Hash && block_given? return @j_del.java_method(:basicPublish, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(exchange,routingKey,::Vertx::Util::Utils.to_json_object(),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) end raise ArgumentError, "Invalid arguments when calling basic_publish(exchange,routingKey,message)" end |
- (void) basic_qos(prefetchCount = nil) { ... }
This method returns an undefined value.
Request specific "quality of service" settings, Limiting the number of unacknowledged messages on a channel (or connection). This limit is applied separately to each new consumer on the channel.
93 94 95 96 97 98 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 93 def basic_qos(prefetchCount=nil) if prefetchCount.class == Fixnum && block_given? return @j_del.java_method(:basicQos, [Java::int.java_class,Java::IoVertxCore::Handler.java_class]).call(prefetchCount,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) end raise ArgumentError, "Invalid arguments when calling basic_qos(prefetchCount)" end |
- (true, false) connected?
Check if a connection is open
232 233 234 235 236 237 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 232 def connected? if !block_given? return @j_del.java_method(:isConnected, []).call() end raise ArgumentError, "Invalid arguments when calling connected?()" end |
- (void) exchange_bind(destination = nil, source = nil, routingKey = nil) { ... }
This method returns an undefined value.
Bind an exchange to an exchange.
128 129 130 131 132 133 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 128 def exchange_bind(destination=nil,source=nil,routingKey=nil) if destination.class == String && source.class == String && routingKey.class == String && block_given? return @j_del.java_method(:exchangeBind, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(destination,source,routingKey,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) end raise ArgumentError, "Invalid arguments when calling exchange_bind(destination,source,routingKey)" end |
- (void) exchange_declare(exchange = nil, type = nil, durable = nil, autoDelete = nil) { ... }
This method returns an undefined value.
Declare an exchange.
106 107 108 109 110 111 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 106 def exchange_declare(exchange=nil,type=nil,durable=nil,autoDelete=nil) if exchange.class == String && type.class == String && (durable.class == TrueClass || durable.class == FalseClass) && (autoDelete.class == TrueClass || autoDelete.class == FalseClass) && block_given? return @j_del.java_method(:exchangeDeclare, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::boolean.java_class,Java::boolean.java_class,Java::IoVertxCore::Handler.java_class]).call(exchange,type,durable,autoDelete,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) end raise ArgumentError, "Invalid arguments when calling exchange_declare(exchange,type,durable,autoDelete)" end |
- (void) exchange_delete(exchange = nil) { ... }
This method returns an undefined value.
Delete an exchange, without regard for whether it is in use or not.
116 117 118 119 120 121 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 116 def exchange_delete(exchange=nil) if exchange.class == String && block_given? return @j_del.java_method(:exchangeDelete, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(exchange,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) end raise ArgumentError, "Invalid arguments when calling exchange_delete(exchange)" end |
- (void) exchange_unbind(destination = nil, source = nil, routingKey = nil) { ... }
This method returns an undefined value.
Unbind an exchange from an exchange.
140 141 142 143 144 145 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 140 def exchange_unbind(destination=nil,source=nil,routingKey=nil) if destination.class == String && source.class == String && routingKey.class == String && block_given? return @j_del.java_method(:exchangeUnbind, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(destination,source,routingKey,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) end raise ArgumentError, "Invalid arguments when calling exchange_unbind(destination,source,routingKey)" end |
- (void) message_count(queue = nil) { ... }
This method returns an undefined value.
Returns the number of messages in a queue ready to be delivered.
206 207 208 209 210 211 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 206 def (queue=nil) if queue.class == String && block_given? return @j_del.java_method(:messageCount, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(queue,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) })) end raise ArgumentError, "Invalid arguments when calling message_count(queue)" end |
- (true, false) open_channel?
Check if a channel is open
240 241 242 243 244 245 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 240 def open_channel? if !block_given? return @j_del.java_method(:isOpenChannel, []).call() end raise ArgumentError, "Invalid arguments when calling open_channel?()" end |
- (void) queue_bind(queue = nil, exchange = nil, routingKey = nil) { ... }
This method returns an undefined value.
Bind a queue to an exchange
196 197 198 199 200 201 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 196 def queue_bind(queue=nil,exchange=nil,routingKey=nil) if queue.class == String && exchange.class == String && routingKey.class == String && block_given? return @j_del.java_method(:queueBind, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(queue,exchange,routingKey,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) end raise ArgumentError, "Invalid arguments when calling queue_bind(queue,exchange,routingKey)" end |
- (void) queue_declare(queue = nil, durable = nil, exclusive = nil, autoDelete = nil) { ... }
This method returns an undefined value.
Declare a queue
162 163 164 165 166 167 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 162 def queue_declare(queue=nil,durable=nil,exclusive=nil,autoDelete=nil) if queue.class == String && (durable.class == TrueClass || durable.class == FalseClass) && (exclusive.class == TrueClass || exclusive.class == FalseClass) && (autoDelete.class == TrueClass || autoDelete.class == FalseClass) && block_given? return @j_del.java_method(:queueDeclare, [Java::java.lang.String.java_class,Java::boolean.java_class,Java::boolean.java_class,Java::boolean.java_class,Java::IoVertxCore::Handler.java_class]).call(queue,durable,exclusive,autoDelete,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) })) end raise ArgumentError, "Invalid arguments when calling queue_declare(queue,durable,exclusive,autoDelete)" end |
- (void) queue_declare_auto { ... }
This method returns an undefined value.
Actively declare a server-named exclusive, autodelete, non-durable queue.
149 150 151 152 153 154 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 149 def queue_declare_auto if block_given? return @j_del.java_method(:queueDeclareAuto, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) })) end raise ArgumentError, "Invalid arguments when calling queue_declare_auto()" end |
- (void) queue_delete(queue = nil) { ... }
This method returns an undefined value.
Delete a queue, without regard for whether it is in use or has messages on it
172 173 174 175 176 177 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 172 def queue_delete(queue=nil) if queue.class == String && block_given? return @j_del.java_method(:queueDelete, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(queue,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) })) end raise ArgumentError, "Invalid arguments when calling queue_delete(queue)" end |
- (void) queue_delete_if(queue = nil, ifUnused = nil, ifEmpty = nil) { ... }
This method returns an undefined value.
Delete a queue
184 185 186 187 188 189 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 184 def queue_delete_if(queue=nil,ifUnused=nil,ifEmpty=nil) if queue.class == String && (ifUnused.class == TrueClass || ifUnused.class == FalseClass) && (ifEmpty.class == TrueClass || ifEmpty.class == FalseClass) && block_given? return @j_del.java_method(:queueDeleteIf, [Java::java.lang.String.java_class,Java::boolean.java_class,Java::boolean.java_class,Java::IoVertxCore::Handler.java_class]).call(queue,ifUnused,ifEmpty,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) })) end raise ArgumentError, "Invalid arguments when calling queue_delete_if(queue,ifUnused,ifEmpty)" end |
- (void) start { ... }
This method returns an undefined value.
Start the rabbitMQ client. Create the connection and the chanel.
215 216 217 218 219 220 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 215 def start if block_given? return @j_del.java_method(:start, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) end raise ArgumentError, "Invalid arguments when calling start()" end |
- (void) stop { ... }
This method returns an undefined value.
Stop the rabbitMQ client. Close the connection and its chanel.
224 225 226 227 228 229 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 224 def stop if block_given? return @j_del.java_method(:stop, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) end raise ArgumentError, "Invalid arguments when calling stop()" end |