ruby-amqp / hutch

A system for processing messages from RabbitMQ.
https://gocardless.com/blog/hutch-inter-service-communication-with-rabbitmq/
MIT License
857 stars 137 forks source link

NameError (uninitialized constant Hutch::Broker::Bunny) on JRuby #394

Open nulllvoid opened 1 year ago

nulllvoid commented 1 year ago

-> irb
Ignoring jaro_winkler-1.5.4 because its extensions are not built. Try: gem pristine jaro_winkler --version 1.5.4 jruby-9.3.3.0 :001 > require 'hutch' => true jruby-9.3.3.0 :002 > Hutch.connect 2023-02-13T09:38:07Z 82398 INFO -- connecting to rabbitmq (amqp://guest@127.0.0.1:5672/) 2023-02-13T09:38:07Z 82398 INFO -- connected to RabbitMQ at 127.0.0.1 as guest 2023-02-13T09:38:07Z 82398 INFO -- opening rabbitmq channel with pool size 1, abort on exception false 2023-02-13T09:38:07Z 82398 INFO -- using topic exchange 'hutch' Traceback (most recent call last): 16: from /Users/shivamshah/.rvm/rubies/jruby-9.3.3.0/lib/ruby/gems/shared/gems/irb-1.0.0/exe/irb:11:in <main>' 15: from org/jruby/RubyKernel.java:1237:incatch' 14: from org/jruby/RubyKernel.java:1237:in catch' 13: from org/jruby/RubyKernel.java:1507:inloop' 12: from org/jruby/RubyKernel.java:1091:in eval' 11: from (irb):2:inevaluate' 10: from /Users/shivamshah/.rvm/gems/jruby-9.3.3.0/gems/hutch-1.1.0/lib/hutch.rb:45:in connect' 9: from org/jruby/ext/thread/Mutex.java:171:insynchronize' 8: from /Users/shivamshah/.rvm/gems/jruby-9.3.3.0/gems/hutch-1.1.0/lib/hutch.rb:48:in block in connect' 7: from /Users/shivamshah/.rvm/gems/jruby-9.3.3.0/gems/hutch-1.1.0/lib/hutch/broker.rb:48:inconnect' 6: from /Users/shivamshah/.rvm/gems/jruby-9.3.3.0/gems/hutch-1.1.0/lib/hutch/broker.rb:87:in set_up_amqp_connection' 5: from /Users/shivamshah/.rvm/gems/jruby-9.3.3.0/gems/hutch-1.1.0/lib/hutch/broker.rb:135:indeclare_exchange!' 4: from /Users/shivamshah/.rvm/gems/jruby-9.3.3.0/gems/hutch-1.1.0/lib/hutch/broker.rb:129:in declare_exchange' 3: from /Users/shivamshah/.rvm/gems/jruby-9.3.3.0/gems/hutch-1.1.0/lib/hutch/broker.rb:355:inwith_bunny_precondition_handler' 2: from /Users/shivamshah/.rvm/gems/jruby-9.3.3.0/gems/hutch-1.1.0/lib/hutch/broker.rb:130:in block in declare_exchange' 1: from org/jruby/RubyModule.java:3948:inconst_missing' NameError (uninitialized constant Hutch::Broker::Bunny)

nulllvoid commented 1 year ago

getting this issue on bundle exec hutch also

michaelklishin commented 1 year ago

JRuby constant resolution behavior must be somehow different from CRuby and it affects broker.rb in Hutch. JRuby users are welcome to investigate this.