Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 1.4.0 (in development)
## 1.4.0 (Apr 6, 2026)

### Ruby 3.0 is Now Required

Expand Down Expand Up @@ -39,6 +39,13 @@ GitHub issue: [#414](https://github.com/ruby-amqp/hutch/pull/414)
### Migrated Datadog Tracer From the `ddtrace` Gem to `datadog`

The Datadog tracer now uses the `datadog` gem instead of the deprecated `ddtrace`.
The `ddtrace` gem is still supported but emits a deprecation warning at load time.
Support for `ddtrace` will be removed in Hutch 2.0.

### Deprecated `SentryRaven` Error Handler

`Hutch::ErrorHandlers::SentryRaven` now emits a deprecation warning and will be
removed in Hutch 2.0. Use `Hutch::ErrorHandlers::Sentry` (backed by `sentry-ruby`) instead.

### Rails 8.x Compatibility

Expand Down
3 changes: 3 additions & 0 deletions lib/hutch/error_handlers/sentry_raven.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ def initialize
unless Raven.respond_to?(:capture_exception)
raise "The Hutch Sentry error handler requires Raven >= 0.4.0"
end

warn "[DEPRECATION] Hutch::ErrorHandlers::SentryRaven is deprecated and will be removed in Hutch 2.0. " \
"Use Hutch::ErrorHandlers::Sentry (backed by the sentry-ruby gem) instead." \
end

def handle(properties, payload, consumer, ex)
Expand Down
8 changes: 5 additions & 3 deletions lib/hutch/tracers/datadog.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
begin
require 'ddtrace'
require 'ddtrace/auto_instrument'
rescue LoadError
require 'datadog'
require 'datadog/auto_instrument'
rescue LoadError
require 'ddtrace'
require 'ddtrace/auto_instrument'
warn "[DEPRECATION] The ddtrace gem is deprecated and Hutch will require the datadog gem in 2.0. " \
"Please switch to the datadog gem."
end

module Hutch
Expand Down
48 changes: 48 additions & 0 deletions spec/integration/publish_consume_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
require 'spec_helper'
require 'hutch/broker'
require 'hutch/worker'
require 'hutch/consumer'
require 'securerandom'
require 'timeout'

describe 'publishing and consuming messages', rabbitmq: true, adapter: :bunny do
let(:exchange_name) { "hutch.test.#{SecureRandom.hex(4)}" }
let(:routing_key) { "test.message" }
let(:received) { [] }

let(:consumer_class) do
msgs = received
rk = routing_key
qn = "test_consumer_#{SecureRandom.hex(4)}"

Class.new do
include Hutch::Consumer
consume rk
queue_name qn

define_method(:process) { |message| msgs << message.body }
end
end

let(:broker) { Hutch::Broker.new }
let(:worker) { Hutch::Worker.new(broker, [consumer_class], []) }

before do
Hutch::Config.set(:mq_exchange, exchange_name)
end

after do
broker.disconnect rescue nil
end

it 'publishes and consumes a message' do
broker.connect
worker.setup_queues

broker.publish(routing_key, { test: 'data' })

Timeout.timeout(5) { sleep 0.1 until received.any? }

expect(received.first).to eq('test' => 'data')
end
end
Loading