hutch 0.25.0-java → 2.0.0.rc1-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +402 -5
- data/LICENSE +1 -0
- data/README.md +157 -47
- data/bin/ci/before_build.sh +20 -0
- data/bin/ci/before_build_docker.sh +15 -0
- data/bin/ci/install_on_debian.sh +46 -0
- data/lib/hutch/acknowledgements/nack_on_all_failures.rb +1 -1
- data/lib/hutch/adapters/bunny.rb +29 -1
- data/lib/hutch/adapters/march_hare.rb +24 -0
- data/lib/hutch/broker.rb +98 -35
- data/lib/hutch/cli.rb +16 -12
- data/lib/hutch/config.rb +42 -13
- data/lib/hutch/consumer.rb +63 -4
- data/lib/hutch/error_handlers/bugsnag.rb +30 -0
- data/lib/hutch/error_handlers/{opbeat.rb → rollbar.rb} +11 -13
- data/lib/hutch/error_handlers/sentry.rb +6 -11
- data/lib/hutch/error_handlers.rb +2 -1
- data/lib/hutch/publisher.rb +1 -1
- data/lib/hutch/serializers/json.rb +3 -3
- data/lib/hutch/tracers/datadog.rb +18 -0
- data/lib/hutch/tracers.rb +1 -1
- data/lib/hutch/version.rb +1 -2
- data/lib/hutch/worker.rb +46 -9
- data/lib/hutch.rb +8 -4
- data/lib/yard-settings/yard-settings.rb +2 -2
- data/spec/hutch/broker_spec.rb +192 -14
- data/spec/hutch/cli_spec.rb +12 -9
- data/spec/hutch/config_spec.rb +84 -12
- data/spec/hutch/consumer_spec.rb +93 -4
- data/spec/hutch/error_handlers/airbrake_spec.rb +4 -1
- data/spec/hutch/error_handlers/bugsnag_spec.rb +56 -0
- data/spec/hutch/error_handlers/honeybadger_spec.rb +1 -1
- data/spec/hutch/error_handlers/logger_spec.rb +1 -1
- data/spec/hutch/error_handlers/rollbar_spec.rb +45 -0
- data/spec/hutch/error_handlers/sentry_spec.rb +13 -3
- data/spec/hutch/message_spec.rb +1 -1
- data/spec/hutch/tracers/datadog_spec.rb +46 -0
- data/spec/hutch/waiter_spec.rb +2 -2
- data/spec/hutch/worker_spec.rb +138 -24
- data/spec/integration/channel_recovery_spec.rb +187 -0
- data/spec/integration/publish_consume_spec.rb +47 -0
- metadata +32 -59
- data/.gitignore +0 -10
- data/.rspec +0 -1
- data/.travis.yml +0 -16
- data/.yardopts +0 -5
- data/Gemfile +0 -33
- data/Guardfile +0 -14
- data/Rakefile +0 -21
- data/examples/consumer.rb +0 -13
- data/examples/producer.rb +0 -10
- data/hutch.gemspec +0 -29
- data/lib/hutch/tracers/opbeat.rb +0 -37
- data/spec/hutch/error_handlers/opbeat_spec.rb +0 -37
- data/spec/spec_helper.rb +0 -42
- data/spec/tracers/opbeat_spec.rb +0 -44
data/spec/spec_helper.rb
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
require 'simplecov'
|
|
2
|
-
if ENV['TRAVIS']
|
|
3
|
-
require 'coveralls'
|
|
4
|
-
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
|
5
|
-
end
|
|
6
|
-
|
|
7
|
-
SimpleCov.start do
|
|
8
|
-
add_filter '/spec/'
|
|
9
|
-
add_filter '/.bundle/'
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
require 'raven'
|
|
13
|
-
require 'hutch'
|
|
14
|
-
require 'logger'
|
|
15
|
-
|
|
16
|
-
# set logger to be a null logger
|
|
17
|
-
Hutch::Logging.logger = Logger.new(File::NULL)
|
|
18
|
-
|
|
19
|
-
RSpec.configure do |config|
|
|
20
|
-
config.raise_errors_for_deprecations!
|
|
21
|
-
|
|
22
|
-
if defined?(JRUBY_VERSION)
|
|
23
|
-
config.filter_run_excluding adapter: :bunny
|
|
24
|
-
else
|
|
25
|
-
config.filter_run_excluding adapter: :march_hare
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
config.mock_with :rspec do |mocks|
|
|
29
|
-
mocks.verify_partial_doubles = true
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
# Constants (classes, etc) defined within a block passed to this method
|
|
34
|
-
# will be removed from the global namespace after the block as run.
|
|
35
|
-
def isolate_constants
|
|
36
|
-
existing_constants = Object.constants
|
|
37
|
-
yield
|
|
38
|
-
ensure
|
|
39
|
-
(Object.constants - existing_constants).each do |constant|
|
|
40
|
-
Object.send(:remove_const, constant)
|
|
41
|
-
end
|
|
42
|
-
end
|
data/spec/tracers/opbeat_spec.rb
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
require 'hutch/message'
|
|
2
|
-
require 'hutch/serializers/identity'
|
|
3
|
-
require 'hutch/tracers'
|
|
4
|
-
|
|
5
|
-
RSpec.describe Hutch::Tracers::Opbeat do
|
|
6
|
-
let(:consumer) { double('the-consumer') }
|
|
7
|
-
|
|
8
|
-
subject(:tracer) { described_class.new(consumer) }
|
|
9
|
-
|
|
10
|
-
let(:message) do
|
|
11
|
-
Hutch::Message.new(double('the-delivery-info', routing_key: 'foo.bar',
|
|
12
|
-
exchange: 'foo'),
|
|
13
|
-
double('the-properties', message_id: 'the-id',
|
|
14
|
-
timestamp: 'the-time'),
|
|
15
|
-
double('the-payload', to_s: 'the-body'),
|
|
16
|
-
Hutch::Serializers::Identity)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
it 'formats messages as extra information' do
|
|
20
|
-
expected_extra = {
|
|
21
|
-
body: 'the-body',
|
|
22
|
-
message_id: 'the-id',
|
|
23
|
-
timestamp: 'the-time',
|
|
24
|
-
routing_key: 'foo.bar'
|
|
25
|
-
}
|
|
26
|
-
expect(Opbeat).to receive(:transaction).with(anything,
|
|
27
|
-
'messaging.hutch',
|
|
28
|
-
extra: expected_extra) {
|
|
29
|
-
double('done-callback', done: true)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
tracer.handle(message)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
it 'presents consumer class name as Opbeat tracing signature' do
|
|
36
|
-
expect(Opbeat).to receive(:transaction).with(consumer.class.name,
|
|
37
|
-
'messaging.hutch',
|
|
38
|
-
anything) {
|
|
39
|
-
double('done-callback', done: true)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
tracer.handle(message)
|
|
43
|
-
end
|
|
44
|
-
end
|