Class: VertxRabbitmq::RabbitMQClient

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


17
18
19
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 17

def @@j_api_type.accept?(obj)
  obj.class == RabbitMQClient
end

+ (::VertxRabbitmq::RabbitMQClient) create(vertx = nil, config = nil)

Create and return a client.

Parameters:

  • vertx (::Vertx::Vertx) (defaults to: nil)
    the vertx instance
  • config (Hash) (defaults to: nil)
    the client config

Returns:

Raises:

  • (ArgumentError)


36
37
38
39
40
41
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 36

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::IoVertxRabbitmq::RabbitMQOptions.java_class]).call(vertx.j_del,Java::IoVertxRabbitmq::RabbitMQOptions.new(::Vertx::Util::Utils.to_json_object(config))),::VertxRabbitmq::RabbitMQClient)
  end
  raise ArgumentError, "Invalid arguments when calling create(#{vertx},#{config})"
end

+ (Object) j_api_type



26
27
28
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 26

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



29
30
31
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 29

def self.j_class
  Java::IoVertxRabbitmq::RabbitMQClient.java_class
end

+ (Object) unwrap(obj)



23
24
25
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 23

def @@j_api_type.unwrap(obj)
  obj.j_del
end

+ (Object) wrap(obj)



20
21
22
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 20

def @@j_api_type.wrap(obj)
  RabbitMQClient.new(obj)
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.

Parameters:

  • deliveryTag (Fixnum) (defaults to: nil)
  • multiple (true, false) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


48
49
50
51
52
53
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 48

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, resultHandler = nil) { ... }

This method returns an undefined value.

Start a non-nolocal, non-exclusive consumer, with a server-generated consumerTag and error handler

Parameters:

  • queue (String) (defaults to: nil)
  • address (String) (defaults to: nil)
  • autoAck (true, false) (defaults to: nil)
  • resultHandler (Proc) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


84
85
86
87
88
89
90
91
92
93
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 84

def basic_consume(queue=nil,address=nil,autoAck=nil,resultHandler=nil)
  if queue.class == String && address.class == String && block_given? && autoAck == nil && resultHandler == 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? && resultHandler == nil
    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) }))
  elsif queue.class == String && address.class == String && (autoAck.class == TrueClass || autoAck.class == FalseClass) && resultHandler.class == Proc && 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,Java::IoVertxCore::Handler.java_class]).call(queue,address,autoAck,(Proc.new { |ar| resultHandler.call(ar.failed ? ar.cause : nil) }),(Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)) }))
  end
  raise ArgumentError, "Invalid arguments when calling basic_consume(#{queue},#{address},#{autoAck},#{resultHandler})"
end

- (void) basic_get(queue = nil, autoAck = nil) { ... }

This method returns an undefined value.

Retrieve a message from a queue using AMQP.Basic.Get

Parameters:

  • queue (String) (defaults to: nil)
  • autoAck (true, false) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


71
72
73
74
75
76
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 71

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.

Parameters:

  • deliveryTag (Fixnum) (defaults to: nil)
  • multiple (true, false) (defaults to: nil)
  • requeue (true, false) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


60
61
62
63
64
65
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 60

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.

Parameters:

  • exchange (String) (defaults to: nil)
  • routingKey (String) (defaults to: nil)
  • message (Hash{String => Object}) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


101
102
103
104
105
106
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 101

def basic_publish(exchange=nil,routingKey=nil,message=nil)
  if exchange.class == String && routingKey.class == String && message.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(message),(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.

Parameters:

  • prefetchCount (Fixnum) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


134
135
136
137
138
139
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 134

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

- (void) confirm_select { ... }

This method returns an undefined value.

Enables publisher acknowledgements on this channel. Can be called once during client initialisation. Calls to basicPublish() will have to be confirmed.

Yields:

Raises:

  • (ArgumentError)


111
112
113
114
115
116
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 111

def confirm_select
  if block_given?
    return @j_del.java_method(:confirmSelect, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
  end
  raise ArgumentError, "Invalid arguments when calling confirm_select()"
end

- (true, false) connected?

Check if a connection is open

Returns:

  • (true, false)
    true when the connection is open, false otherwise

Raises:

  • (ArgumentError)


279
280
281
282
283
284
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 279

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.

Parameters:

  • destination (String) (defaults to: nil)
  • source (String) (defaults to: nil)
  • routingKey (String) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


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 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, config = nil) { ... }

This method returns an undefined value.

Declare an exchange with additional parameters such as dead lettering or an alternate exchnage.

Parameters:

  • exchange (String) (defaults to: nil)
  • type (String) (defaults to: nil)
  • durable (true, false) (defaults to: nil)
  • autoDelete (true, false) (defaults to: nil)
  • config (Hash{String => String}) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


148
149
150
151
152
153
154
155
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 148

def exchange_declare(exchange=nil,type=nil,durable=nil,autoDelete=nil,config=nil)
  if exchange.class == String && type.class == String && (durable.class == TrueClass || durable.class == FalseClass) && (autoDelete.class == TrueClass || autoDelete.class == FalseClass) && block_given? && config == nil
    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) }))
  elsif exchange.class == String && type.class == String && (durable.class == TrueClass || durable.class == FalseClass) && (autoDelete.class == TrueClass || autoDelete.class == FalseClass) && config.class == Hash && 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::JavaUtil::Map.java_class,Java::IoVertxCore::Handler.java_class]).call(exchange,type,durable,autoDelete,Hash[config.map { |k,v| [k,v] }],(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
  end
  raise ArgumentError, "Invalid arguments when calling exchange_declare(#{exchange},#{type},#{durable},#{autoDelete},#{config})"
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.

Parameters:

  • exchange (String) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


160
161
162
163
164
165
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 160

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.

Parameters:

  • destination (String) (defaults to: nil)
  • source (String) (defaults to: nil)
  • routingKey (String) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


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 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.

Parameters:

  • queue (String) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


253
254
255
256
257
258
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 253

def message_count(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

Returns:

  • (true, false)
    true when the connection is open, false otherwise

Raises:

  • (ArgumentError)


287
288
289
290
291
292
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 287

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

Parameters:

  • queue (String) (defaults to: nil)
  • exchange (String) (defaults to: nil)
  • routingKey (String) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


243
244
245
246
247
248
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 243

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, config = nil) { ... }

This method returns an undefined value.

Declare a queue with config options

Parameters:

  • queue (String) (defaults to: nil)
  • durable (true, false) (defaults to: nil)
  • exclusive (true, false) (defaults to: nil)
  • autoDelete (true, false) (defaults to: nil)
  • config (Hash{String => String}) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


207
208
209
210
211
212
213
214
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 207

def queue_declare(queue=nil,durable=nil,exclusive=nil,autoDelete=nil,config=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? && config == nil
    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) }))
  elsif queue.class == String && (durable.class == TrueClass || durable.class == FalseClass) && (exclusive.class == TrueClass || exclusive.class == FalseClass) && (autoDelete.class == TrueClass || autoDelete.class == FalseClass) && config.class == Hash && 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::JavaUtil::Map.java_class,Java::IoVertxCore::Handler.java_class]).call(queue,durable,exclusive,autoDelete,Hash[config.map { |k,v| [k,v] }],(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},#{config})"
end

- (void) queue_declare_auto { ... }

This method returns an undefined value.

Actively declare a server-named exclusive, autodelete, non-durable queue.

Yields:

Raises:

  • (ArgumentError)


193
194
195
196
197
198
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 193

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

Parameters:

  • queue (String) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


219
220
221
222
223
224
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 219

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

Parameters:

  • queue (String) (defaults to: nil)
  • ifUnused (true, false) (defaults to: nil)
  • ifEmpty (true, false) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


231
232
233
234
235
236
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 231

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.

Yields:

Raises:

  • (ArgumentError)


262
263
264
265
266
267
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 262

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.

Yields:

Raises:

  • (ArgumentError)


271
272
273
274
275
276
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 271

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

- (void) wait_for_confirms(timeout = nil) { ... }

This method returns an undefined value.

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.

Parameters:

  • timeout (Fixnum) (defaults to: nil)

Yields:

Raises:

  • (ArgumentError)


121
122
123
124
125
126
127
128
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-rabbitmq/rabbit_mq_client.rb', line 121

def wait_for_confirms(timeout=nil)
  if block_given? && timeout == nil
    return @j_del.java_method(:waitForConfirms, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
  elsif timeout.class == Fixnum && block_given?
    return @j_del.java_method(:waitForConfirms, [Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(timeout,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
  end
  raise ArgumentError, "Invalid arguments when calling wait_for_confirms(#{timeout})"
end