-
Notifications
You must be signed in to change notification settings - Fork 0
Maintenance: upgrade connection_pool to v3 + dependency bumps #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
47c2415
Update NodeJS
brerx cd4fd1f
Update Ruby
brerx 346a6f0
Update npm deps
brerx 3982e53
Update NodeJS
brerx d2498a4
Update NodeJS
brerx db57049
Add errors.rb to CLAUDE.md directory layout
brerx 7a3a7bb
Pin parallel < 2.0 to keep Ruby 3.2 support
brerx 0d0536f
Drop Ruby 3.2 support (EOL 2026-03-31)
brerx cdf8a08
Use current Node LTS (24) instead of Current (26)
brerx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,20 @@ | ||
| # Specify a different separator for branch names | ||
|
|
||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: 'github-actions' | ||
| directory: '/' | ||
|
|
||
| multi-ecosystem-groups: | ||
| security: | ||
| schedule: | ||
| interval: 'weekly' | ||
| interval: 'daily' | ||
| open-pull-requests-limit: 0 # disables version-update PRs; security PRs unaffected | ||
| pull-request-branch-name: | ||
| separator: '-' | ||
|
|
||
| updates: | ||
| - package-ecosystem: 'bundler' | ||
| directory: '/' | ||
| patterns: ['*'] | ||
| multi-ecosystem-group: 'security' | ||
|
|
||
| - package-ecosystem: 'github-actions' | ||
| directory: '/' | ||
| patterns: ['*'] | ||
| multi-ecosystem-group: 'security' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| ruby 4.0.2 | ||
| nodejs 24.14.1 | ||
| ruby 4.0.5 | ||
| nodejs 26.2.0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # ears | ||
|
|
||
| Ruby gem for building RabbitMQ consumers using Bunny. | ||
|
|
||
| ## Stack | ||
|
|
||
| - **Ruby** 4.0.x (see `.tool-versions`) | ||
| - **Bunny** >= 3.0.0 — AMQP client | ||
| - **connection_pool** ~> 3.0 — thread-safe channel pools for publishers | ||
| - **json** >= 2.9.0 — JSON serialization in middleware | ||
| - Dev tools: RSpec, RuboCop (rubocop-rspec, rubocop-rake), SimpleCov, YARD, Prettier (via Node) | ||
|
|
||
| ## Common Commands | ||
|
|
||
| ```bash | ||
| # Install deps | ||
| bundle install | ||
| npm install | ||
|
|
||
| # Tests | ||
| bundle exec rspec | ||
|
|
||
| # Lint / format | ||
| bundle exec rubocop | ||
| npm run lint # Prettier on Ruby files | ||
|
|
||
| # Autofix rubocop | ||
| bundle exec rubocop -A | ||
|
|
||
| # Docs | ||
| bundle exec yard doc | ||
| ``` | ||
|
|
||
| ## Directory Layout | ||
|
|
||
| ``` | ||
| lib/ | ||
| ears.rb # Top-level module: configure, connection, channel, setup, run! | ||
| ears/ | ||
| configuration.rb # Ears::Configuration — all tunable constants | ||
| errors.rb # Custom error classes (required by configuration.rb) | ||
| consumer.rb # Abstract base class; subclass and override #work | ||
| consumer_wrapper.rb # Wraps a Consumer for Bunny delivery callbacks | ||
| setup.rb # Ears::Setup — DSL for exchange/queue/consumer wiring | ||
| publisher.rb # Ears::Publisher — publish and publish_with_confirmation | ||
| publisher_channel_pool.rb # Thread-safe ConnectionPool for publisher channels | ||
| publisher_confirmation_handler.rb | ||
| publisher_retry_handler.rb | ||
| middleware.rb # Middleware base | ||
| middlewares/ | ||
| appsignal.rb | ||
| json.rb # Deserializes JSON payload before #work | ||
| max_retries.rb | ||
| testing.rb # Ears::Testing module entry-point | ||
| testing/ | ||
| matchers.rb | ||
| message_capture.rb | ||
| publisher_mock.rb | ||
| test_helper.rb | ||
| spec/ # RSpec specs (mirrors lib/ structure) | ||
| ``` | ||
|
|
||
| ## Architecture | ||
|
|
||
| **Consumer pattern:** Subclass `Ears::Consumer`, call `.configure(queue:, exchange:, routing_keys:, ...)` in the class body, override `#work(delivery_info, metadata, payload)` returning `:ack`, `:reject`, or `:requeue`. Middleware chain is applied in reverse order around `#work`. | ||
|
|
||
| **Publisher pattern:** Instantiate `Ears::Publisher.new(exchange_name)`, call `#publish(data, routing_key:)` or `#publish_with_confirmation(data, routing_key:)`. Internally uses `PublisherChannelPool` (two `ConnectionPool` instances — one standard, one with confirms). Pool is lazy-initialised with a mutex for thread safety and is fork-safe (resets on PID change). | ||
|
|
||
| **Setup DSL:** `Ears.setup { exchange(...); queue(...); consumer(...) }` or `Ears.setup_consumers(*classes)` which auto-wires from each class's `.configure` metadata. | ||
|
|
||
| **Configuration knobs** (set via `Ears.configure { |c| c.foo = ... }`): `rabbitmq_url`, `connection_name` (required), `publisher_pool_size` (32), `publisher_pool_timeout` (2s), `publisher_confirms_pool_size` (32), `publisher_confirms_timeout` (5s), plus retry/backoff params. | ||
|
|
||
| ## Testing Support | ||
|
|
||
| `require 'ears/testing'` — provides `Ears::Testing::TestHelper` (RSpec include), `PublisherMock`, `MessageCapture`, and custom matchers (`have_been_published`). | ||
|
|
||
| ## Known Tech Debt | ||
|
|
||
| - `Metrics/MethodLength` is suppressed for `Configuration#initialize` (initialises ~15 instance variables from constants; an options-hash refactor would be the real fix). | ||
| - `.rubocop_todo.yml` may have lingering entries — check before adding new inline disables. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| module Ears | ||
| VERSION = '0.25.0' | ||
| VERSION = '0.26.0' | ||
| end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest we stick to the current LTS version