Skip to content

Commit 60646d9

Browse files
Merge pull request #418 from Garaio-REM/prepare-for-1-4-release
Prepare for 1.4.0 Release
2 parents 3ec6da8 + bd2bce6 commit 60646d9

4 files changed

Lines changed: 64 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 1.4.0 (in development)
1+
## 1.4.0 (Apr 6, 2026)
22

33
### Ruby 3.0 is Now Required
44

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

4141
The Datadog tracer now uses the `datadog` gem instead of the deprecated `ddtrace`.
42+
The `ddtrace` gem is still supported but emits a deprecation warning at load time.
43+
Support for `ddtrace` will be removed in Hutch 2.0.
44+
45+
### Deprecated `SentryRaven` Error Handler
46+
47+
`Hutch::ErrorHandlers::SentryRaven` now emits a deprecation warning and will be
48+
removed in Hutch 2.0. Use `Hutch::ErrorHandlers::Sentry` (backed by `sentry-ruby`) instead.
4249

4350
### Rails 8.x Compatibility
4451

lib/hutch/error_handlers/sentry_raven.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ def initialize
1010
unless Raven.respond_to?(:capture_exception)
1111
raise "The Hutch Sentry error handler requires Raven >= 0.4.0"
1212
end
13+
14+
warn "[DEPRECATION] Hutch::ErrorHandlers::SentryRaven is deprecated and will be removed in Hutch 2.0. " \
15+
"Use Hutch::ErrorHandlers::Sentry (backed by the sentry-ruby gem) instead." \
1316
end
1417

1518
def handle(properties, payload, consumer, ex)

lib/hutch/tracers/datadog.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
begin
2-
require 'ddtrace'
3-
require 'ddtrace/auto_instrument'
4-
rescue LoadError
52
require 'datadog'
63
require 'datadog/auto_instrument'
4+
rescue LoadError
5+
require 'ddtrace'
6+
require 'ddtrace/auto_instrument'
7+
warn "[DEPRECATION] The ddtrace gem is deprecated and Hutch will require the datadog gem in 2.0. " \
8+
"Please switch to the datadog gem."
79
end
810

911
module Hutch
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
require 'spec_helper'
2+
require 'hutch/broker'
3+
require 'hutch/worker'
4+
require 'hutch/consumer'
5+
require 'securerandom'
6+
require 'timeout'
7+
8+
describe 'publishing and consuming messages', rabbitmq: true, adapter: :bunny do
9+
let(:exchange_name) { "hutch.test.#{SecureRandom.hex(4)}" }
10+
let(:routing_key) { "test.message" }
11+
let(:received) { [] }
12+
13+
let(:consumer_class) do
14+
msgs = received
15+
rk = routing_key
16+
qn = "test_consumer_#{SecureRandom.hex(4)}"
17+
18+
Class.new do
19+
include Hutch::Consumer
20+
consume rk
21+
queue_name qn
22+
23+
define_method(:process) { |message| msgs << message.body }
24+
end
25+
end
26+
27+
let(:broker) { Hutch::Broker.new }
28+
let(:worker) { Hutch::Worker.new(broker, [consumer_class], []) }
29+
30+
before do
31+
Hutch::Config.set(:mq_exchange, exchange_name)
32+
end
33+
34+
after do
35+
broker.disconnect rescue nil
36+
end
37+
38+
it 'publishes and consumes a message' do
39+
broker.connect
40+
worker.setup_queues
41+
42+
broker.publish(routing_key, { test: 'data' })
43+
44+
Timeout.timeout(5) { sleep 0.1 until received.any? }
45+
46+
expect(received.first).to eq('test' => 'data')
47+
end
48+
end

0 commit comments

Comments
 (0)