Changed files:
config/application.rb
: use Hutch Adapterconfig/initializers/z-001-hutch.rb
: to initlize Hutch and Hutch::Scheduleapp/jobs/plan_job.rb
: to test job with ActiveJob error retry.app/jobs/bow_job.rb
: to test ActiveJob use hutch to driver it.
docker-compose up
: launch rabbitmqhutch -v
to run hutch process.rails c
to enqueue message with:
BowJob.set(wait: 5.seconds).perform_later(a: 1)
PlanJob.perform_later(b: 2)
will retry 5 times with exponentially_longer delay algorithm.
AbcConsumer
,BbcConsumer
two Hutch::Consumer, direct use for raw message handleing. [app/consumers
]BowJob
,PlanJob
two ActiveJob::Base, use ActiveJob deal with background job. [app/jobs
]