Using the more explicit Java symbol access pattern
This commit is contained in:
parent
e1a07fadd9
commit
5228eba27e
@ -1,9 +1,6 @@
|
|||||||
require 'sylvilagus/ch02/hello_world'
|
require 'sylvilagus/ch02/hello_world'
|
||||||
|
|
||||||
import com.rabbitmq.client.DefaultConsumer
|
class Sylvilagus::Ch02::HelloWorldConsumer < Java::ComRabbitmqClient::DefaultConsumer
|
||||||
import org.jruby.RubyString
|
|
||||||
|
|
||||||
class Sylvilagus::Ch02::HelloWorldConsumer < DefaultConsumer
|
|
||||||
class << self
|
class << self
|
||||||
include Sylvilagus::Ch02::HelloWorld::ClassMethods
|
include Sylvilagus::Ch02::HelloWorld::ClassMethods
|
||||||
|
|
||||||
@ -27,7 +24,7 @@ class Sylvilagus::Ch02::HelloWorldConsumer < DefaultConsumer
|
|||||||
end
|
end
|
||||||
|
|
||||||
def handleDelivery(consumer_tag, envelope, properties, body)
|
def handleDelivery(consumer_tag, envelope, properties, body)
|
||||||
body_string = RubyString.bytes_to_string(body)
|
body_string = Java::OrgJruby::RubyString.bytes_to_string(body)
|
||||||
|
|
||||||
puts "Consumed #{body_string.inspect}"
|
puts "Consumed #{body_string.inspect}"
|
||||||
channel.basic_ack(envelope.delivery_tag, false)
|
channel.basic_ack(envelope.delivery_tag, false)
|
||||||
|
Loading…
Reference in New Issue
Block a user