From 5228eba27e99e85c63cb49614af42a10a6e6fa64 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sun, 2 Dec 2012 20:28:07 -0500 Subject: [PATCH] Using the more explicit Java symbol access pattern --- .../jruby/lib/sylvilagus/ch02/hello_world_consumer.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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)