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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +402 -5
  3. data/LICENSE +1 -0
  4. data/README.md +157 -47
  5. data/bin/ci/before_build.sh +20 -0
  6. data/bin/ci/before_build_docker.sh +15 -0
  7. data/bin/ci/install_on_debian.sh +46 -0
  8. data/lib/hutch/acknowledgements/nack_on_all_failures.rb +1 -1
  9. data/lib/hutch/adapters/bunny.rb +29 -1
  10. data/lib/hutch/adapters/march_hare.rb +24 -0
  11. data/lib/hutch/broker.rb +98 -35
  12. data/lib/hutch/cli.rb +16 -12
  13. data/lib/hutch/config.rb +42 -13
  14. data/lib/hutch/consumer.rb +63 -4
  15. data/lib/hutch/error_handlers/bugsnag.rb +30 -0
  16. data/lib/hutch/error_handlers/{opbeat.rb → rollbar.rb} +11 -13
  17. data/lib/hutch/error_handlers/sentry.rb +6 -11
  18. data/lib/hutch/error_handlers.rb +2 -1
  19. data/lib/hutch/publisher.rb +1 -1
  20. data/lib/hutch/serializers/json.rb +3 -3
  21. data/lib/hutch/tracers/datadog.rb +18 -0
  22. data/lib/hutch/tracers.rb +1 -1
  23. data/lib/hutch/version.rb +1 -2
  24. data/lib/hutch/worker.rb +46 -9
  25. data/lib/hutch.rb +8 -4
  26. data/lib/yard-settings/yard-settings.rb +2 -2
  27. data/spec/hutch/broker_spec.rb +192 -14
  28. data/spec/hutch/cli_spec.rb +12 -9
  29. data/spec/hutch/config_spec.rb +84 -12
  30. data/spec/hutch/consumer_spec.rb +93 -4
  31. data/spec/hutch/error_handlers/airbrake_spec.rb +4 -1
  32. data/spec/hutch/error_handlers/bugsnag_spec.rb +56 -0
  33. data/spec/hutch/error_handlers/honeybadger_spec.rb +1 -1
  34. data/spec/hutch/error_handlers/logger_spec.rb +1 -1
  35. data/spec/hutch/error_handlers/rollbar_spec.rb +45 -0
  36. data/spec/hutch/error_handlers/sentry_spec.rb +13 -3
  37. data/spec/hutch/message_spec.rb +1 -1
  38. data/spec/hutch/tracers/datadog_spec.rb +46 -0
  39. data/spec/hutch/waiter_spec.rb +2 -2
  40. data/spec/hutch/worker_spec.rb +138 -24
  41. data/spec/integration/channel_recovery_spec.rb +187 -0
  42. data/spec/integration/publish_consume_spec.rb +47 -0
  43. metadata +32 -59
  44. data/.gitignore +0 -10
  45. data/.rspec +0 -1
  46. data/.travis.yml +0 -16
  47. data/.yardopts +0 -5
  48. data/Gemfile +0 -33
  49. data/Guardfile +0 -14
  50. data/Rakefile +0 -21
  51. data/examples/consumer.rb +0 -13
  52. data/examples/producer.rb +0 -10
  53. data/hutch.gemspec +0 -29
  54. data/lib/hutch/tracers/opbeat.rb +0 -37
  55. data/spec/hutch/error_handlers/opbeat_spec.rb +0 -37
  56. data/spec/spec_helper.rb +0 -42
  57. 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
@@ -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