Class: AceMQ::Rails::Railtie
- Inherits:
-
Rails::Railtie
- Object
- Rails::Railtie
- AceMQ::Rails::Railtie
- Defined in:
- lib/acemq/rails/railtie.rb
Overview
Wires AceMQ into a Rails application.
A Railtie rather than an Engine, because this contributes no routes, no
views, no models and no migrations. An Engine would add a mount point
nobody mounts and an app/ tree nobody fills.
It does four things, in this order:
- Reads
config/acemq.ymlthrough Rails' ownconfig_for, and puts what it finds underconfig.acemqso that an environment file can override any of it. - Builds Configuration from the result, once, after every initializer has had its say.
- Adds
app/consumersto the autoload paths. - Registers the rake tasks and an
at_exitthat closes the connection.
It starts no consumers. That is the whole design and it is enforced here rather than merely recommended: nothing in this file subscribes to anything, so a consumer cannot accidentally end up inside Puma.