Using a fresh install of Rails 7, with the Hutch gem. Added a consumer script to app/consumers.
Ran hutch in the app root directory and got the following output:
2022-07-09T13:40:03Z 39168 INFO -- hutch booted with pid 39168
2022-07-09T13:40:03Z 39168 INFO -- found rails project (.), booting app in development environment
2022-07-09T13:40:04Z 39168 INFO -- connecting to rabbitmq (amqp://guest@127.0.0.1:5672/)
2022-07-09T13:40:04Z 39168 INFO -- connected to RabbitMQ at 127.0.0.1 as guest
2022-07-09T13:40:04Z 39168 INFO -- opening rabbitmq channel with pool size 1, abort on exception false
2022-07-09T13:40:04Z 39168 INFO -- using topic exchange 'hutch'
2022-07-09T13:40:04Z 39168 INFO -- HTTP API use is enabled
2022-07-09T13:40:04Z 39168 INFO -- connecting to rabbitmq HTTP API (http://guest@127.0.0.1:15672/)
2022-07-09T13:40:04Z 39168 INFO -- tracing is disabled
2022-07-09T13:40:04Z 39168 WARN -- no consumer loaded, ensure there's no configuration issue
2022-07-09T13:40:04Z 39168 INFO -- setting up queues
The documentation notes for Zeitwerk loading don't work, more specifically:
::Zeitwerk::Loader.eager_load_all doesn't do anything
autoloader.preload doesn't exist in Rails 7
I also noted that the eager_load_paths correctly loads app/consumers but it's not preloading any of the rb files inside.
If I require the rb file explicitly in the hutch.rb initializer then hutch will pick up the consumer.
ie. require Rails.root.join("app/consumers/test_consumer.rb")
Using a fresh install of Rails 7, with the Hutch gem. Added a consumer script to app/consumers.
Ran hutch in the app root directory and got the following output: 2022-07-09T13:40:03Z 39168 INFO -- hutch booted with pid 39168 2022-07-09T13:40:03Z 39168 INFO -- found rails project (.), booting app in development environment 2022-07-09T13:40:04Z 39168 INFO -- connecting to rabbitmq (amqp://guest@127.0.0.1:5672/) 2022-07-09T13:40:04Z 39168 INFO -- connected to RabbitMQ at 127.0.0.1 as guest 2022-07-09T13:40:04Z 39168 INFO -- opening rabbitmq channel with pool size 1, abort on exception false 2022-07-09T13:40:04Z 39168 INFO -- using topic exchange 'hutch' 2022-07-09T13:40:04Z 39168 INFO -- HTTP API use is enabled 2022-07-09T13:40:04Z 39168 INFO -- connecting to rabbitmq HTTP API (http://guest@127.0.0.1:15672/) 2022-07-09T13:40:04Z 39168 INFO -- tracing is disabled 2022-07-09T13:40:04Z 39168 WARN -- no consumer loaded, ensure there's no configuration issue 2022-07-09T13:40:04Z 39168 INFO -- setting up queues
The documentation notes for Zeitwerk loading don't work, more specifically:
I also noted that the eager_load_paths correctly loads app/consumers but it's not preloading any of the rb files inside. If I require the rb file explicitly in the hutch.rb initializer then hutch will pick up the consumer. ie. require Rails.root.join("app/consumers/test_consumer.rb")