diff --git a/sylvilagus/jruby/lib/sylvilagus/ch02/hello_world_consumer.rb b/sylvilagus/jruby/lib/sylvilagus/ch02/hello_world_consumer.rb index ab528a1..094492c 100644 --- a/sylvilagus/jruby/lib/sylvilagus/ch02/hello_world_consumer.rb +++ b/sylvilagus/jruby/lib/sylvilagus/ch02/hello_world_consumer.rb @@ -1,9 +1,6 @@ require 'sylvilagus/ch02/hello_world' -import com.rabbitmq.client.DefaultConsumer -import org.jruby.RubyString - -class Sylvilagus::Ch02::HelloWorldConsumer < DefaultConsumer +class Sylvilagus::Ch02::HelloWorldConsumer < Java::ComRabbitmqClient::DefaultConsumer class << self include Sylvilagus::Ch02::HelloWorld::ClassMethods @@ -27,7 +24,7 @@ class Sylvilagus::Ch02::HelloWorldConsumer < DefaultConsumer end 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}" channel.basic_ack(envelope.delivery_tag, false)