https://github.com/wppurking/hutch-schedule-demo
https://github.com/wppurking/hutch-schedule-demo
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/wppurking/hutch-schedule-demo
- Owner: wppurking
- Created: 2017-05-16T10:59:36.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-19T11:01:17.000Z (over 2 years ago)
- Last Synced: 2025-01-21T12:47:20.072Z (5 months ago)
- Language: Ruby
- Size: 879 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
Changed files:
1. `config/application.rb`: use Hutch Adapter
1. `config/initializers/z-001-hutch.rb`: to initlize Hutch and Hutch::Schedule
1. `app/jobs/plan_job.rb`: to test job with ActiveJob error retry.
1. `app/jobs/bow_job.rb`: to test ActiveJob use hutch to driver it.
1. `app/consumers/aac_consumer.rb`: have threshold and consume two routing keys
1. `app/consume/bbc_consumer.rb`: normal hutch consumer
1. 'config/hutch.yaml': Hutch Config file# Use
1. `docker-compose up`: launch rabbitmq
2. `hutch -v` to run hutch process.
3. `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.# explain
1. `AbcConsumer`, `BbcConsumer` two Hutch::Consumer, direct use for raw message handleing. [`app/consumers`]
2. `BowJob`, `PlanJob` two ActiveJob::Base, use ActiveJob deal with background job. [`app/jobs`]