hutch 0.24.0 → 0.25.0.pre.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb197fc767359bc60d35790ec650c9c077120d0d
4
- data.tar.gz: e1152a8d434fdc9a4752c095ad5fdce4871ffd9e
3
+ metadata.gz: 720fbfbc59995920a3fa51951df1e692af84a36e
4
+ data.tar.gz: 30fd95c8766d99b42c6a8a45cf3575dce1219e0b
5
5
  SHA512:
6
- metadata.gz: c34020a830413a6e970bfae9e59fecdaebbe770aaf7df753a7f263af6d7dc98b0ae4433a4aafc27d9d8f45689168d0b39a64d3ba4086c05187fc7b0e352d9814
7
- data.tar.gz: cc24d3e6ab11c4979455c06ba057760b00cffae9dd577a39f4f89bfe7b45a33378c2190362c2d003a5418b3e64238d2997610c8b4f8f52a5287d0765563109ad
6
+ metadata.gz: 99b267d79bc4497f353cb96735058c770d42545ed76eb4f53033a1518fc809e11fd68dd6e14ab1a17ccf96bdc8a816b9aeba1fd4dee5d03231e701a0d98be3c8
7
+ data.tar.gz: c3a36d75316070a6bcf163d7ac3e2c0e39e179f34f8e8db2d9ae5dc56fd9b666d931e734ac7352cba143c313835eb28d4659d0fe0569450f1c1ab32e02068ffd
@@ -5,12 +5,12 @@ before_install:
5
5
  - gem install bundler
6
6
  matrix:
7
7
  include:
8
- - rvm: 2.4.0
9
- - rvm: 2.3.3
10
- - rvm: 2.2
8
+ - rvm: 2.4.1
9
+ - rvm: 2.3.4
10
+ - rvm: 2.2.7
11
11
  - rvm: 2.1
12
12
  - rvm: 2.0
13
- - rvm: jruby-9.1.7.0
13
+ - rvm: jruby-9.1.12.0
14
14
  jdk: oraclejdk8
15
15
  env:
16
16
  - JRUBY_OPTS='--debug'
@@ -1,4 +1,10 @@
1
- ## 0.24.0 — (unreleased)
1
+ ## 0.25.0 — (unreleased)
2
+
3
+ No changes yet.
4
+
5
+
6
+
7
+ ## 0.24.0 — February 1st, 2017
2
8
 
3
9
  ### Configurable Consumer Prefixes
4
10
 
data/README.md CHANGED
@@ -80,8 +80,8 @@ message[:id] # => "02ABCXYZ"
80
80
  To subscribe to a topic, pass a routing key to `consume` in the class
81
81
  definition. To bind to multiple routing keys, simply pass extra routing keys
82
82
  in as additional arguments. Refer to the [RabbitMQ docs on topic exchanges
83
- ][topic-docs] for more information about how to use routing keys. Here's an
84
- example consumer:
83
+ ](http://www.rabbitmq.com/tutorials/tutorial-five-ruby.html) for more information
84
+ about how to use routing keys. Here's an example consumer:
85
85
 
86
86
  ```ruby
87
87
  class FailedPaymentConsumer
@@ -120,7 +120,9 @@ class FailedPaymentConsumer
120
120
  end
121
121
  ```
122
122
 
123
- Custom queue arguments can be found on [this page](https://www.rabbitmq.com/extensions.html).
123
+ This sets the `x-max-length` header. For more details, see the [RabbitMQ
124
+ documentation on Queue Length Limit](https://www.rabbitmq.com/maxlength.html). To find out more
125
+ about custom queue arguments, consult the [RabbitMQ documentation on AMQP Protocol Extensions](https://www.rabbitmq.com/extensions.html).
124
126
 
125
127
  Consumers can write to Hutch's log by calling the logger method. The logger method returns
126
128
  a [Logger object](http://ruby-doc.org/stdlib-2.1.2/libdoc/logger/rdoc/Logger.html).
@@ -300,8 +302,8 @@ AMQP.connect(host: config[:host]) do |connection|
300
302
  end
301
303
  ```
302
304
 
303
- If using publisher confirms with amqp gem, see [this issue][pc-issue]
304
- and [this gist][pc-gist] for more info.
305
+ If using publisher confirms with amqp gem, see [this issue](https://github.com/ruby-amqp/amqp/issues/92)
306
+ and [this gist](https://gist.github.com/3042381) for more info.
305
307
 
306
308
  ## Configuration
307
309
 
@@ -384,241 +386,188 @@ Generate with
384
386
  </tr>
385
387
  </thead>
386
388
  <tbody>
387
-
388
389
  <tr>
389
390
  <td><tt>mq_host</tt></td>
390
391
  <td>127.0.0.1</td>
391
392
  <td>String</td>
392
393
  <td><tt>HUTCH_MQ_HOST</tt></td>
393
- <td><p>RabbitMQ hostname</p>
394
- </td>
394
+ <td><p>RabbitMQ hostname</p></td>
395
395
  </tr>
396
-
397
396
  <tr>
398
397
  <td><tt>mq_exchange</tt></td>
399
398
  <td>hutch</td>
400
399
  <td>String</td>
401
400
  <td><tt>HUTCH_MQ_EXCHANGE</tt></td>
402
- <td><p>RabbitMQ Exchange to use for publishing</p>
403
- </td>
401
+ <td><p>RabbitMQ Exchange to use for publishing</p></td>
404
402
  </tr>
405
-
406
403
  <tr>
407
404
  <td><tt>mq_vhost</tt></td>
408
405
  <td>/</td>
409
406
  <td>String</td>
410
407
  <td><tt>HUTCH_MQ_VHOST</tt></td>
411
- <td><p>RabbitMQ vhost to use</p>
412
- </td>
408
+ <td><p>RabbitMQ vhost to use</p></td>
413
409
  </tr>
414
-
415
410
  <tr>
416
411
  <td><tt>mq_username</tt></td>
417
412
  <td>guest</td>
418
413
  <td>String</td>
419
414
  <td><tt>HUTCH_MQ_USERNAME</tt></td>
420
- <td><p>RabbitMQ username to use.</p>
421
- </td>
415
+ <td><p>RabbitMQ username to use.</p></td>
422
416
  </tr>
423
-
424
417
  <tr>
425
418
  <td><tt>mq_password</tt></td>
426
419
  <td>guest</td>
427
420
  <td>String</td>
428
421
  <td><tt>HUTCH_MQ_PASSWORD</tt></td>
429
- <td><p>RabbitMQ password</p>
430
- </td>
422
+ <td><p>RabbitMQ password</p></td>
431
423
  </tr>
432
-
433
424
  <tr>
434
425
  <td><tt>uri</tt></td>
435
426
  <td>nil</td>
436
427
  <td>String</td>
437
428
  <td><tt>HUTCH_URI</tt></td>
438
- <td><p>RabbitMQ URI (takes precedence over MQ username, password, host, port and vhost settings)</p>
439
- </td>
429
+ <td><p>RabbitMQ URI (takes precedence over MQ username, password, host, port and vhost settings)</p></td>
440
430
  </tr>
441
-
442
431
  <tr>
443
432
  <td><tt>mq_api_host</tt></td>
444
433
  <td>127.0.0.1</td>
445
434
  <td>String</td>
446
435
  <td><tt>HUTCH_MQ_API_HOST</tt></td>
447
- <td><p>RabbitMQ HTTP API hostname</p>
448
- </td>
436
+ <td><p>RabbitMQ HTTP API hostname</p></td>
449
437
  </tr>
450
-
451
438
  <tr>
452
439
  <td><tt>mq_port</tt></td>
453
440
  <td>5672</td>
454
441
  <td>Number</td>
455
442
  <td><tt>HUTCH_MQ_PORT</tt></td>
456
- <td><p>RabbitMQ port</p>
457
- </td>
443
+ <td><p>RabbitMQ port</p></td>
458
444
  </tr>
459
-
460
445
  <tr>
461
446
  <td><tt>mq_api_port</tt></td>
462
447
  <td>15672</td>
463
448
  <td>Number</td>
464
449
  <td><tt>HUTCH_MQ_API_PORT</tt></td>
465
- <td><p>RabbitMQ HTTP API port</p>
466
- </td>
450
+ <td><p>RabbitMQ HTTP API port</p></td>
467
451
  </tr>
468
-
469
452
  <tr>
470
453
  <td><tt>heartbeat</tt></td>
471
454
  <td>30</td>
472
455
  <td>Number</td>
473
456
  <td><tt>HUTCH_HEARTBEAT</tt></td>
474
- <td><p><a href="http://rabbitmq.com/heartbeats.html">RabbitMQ heartbeat timeout</a></p>
475
- </td>
457
+ <td><p><a href="http://rabbitmq.com/heartbeats.html">RabbitMQ heartbeat timeout</a></p></td>
476
458
  </tr>
477
-
478
459
  <tr>
479
460
  <td><tt>channel_prefetch</tt></td>
480
461
  <td>0</td>
481
462
  <td>Number</td>
482
463
  <td><tt>HUTCH_CHANNEL_PREFETCH</tt></td>
483
- <td><p>The <tt>basic.qos</tt> prefetch value to use.</p>
484
- </td>
464
+ <td><p>The <tt>basic.qos</tt> prefetch value to use.</p></td>
485
465
  </tr>
486
-
487
466
  <tr>
488
467
  <td><tt>connection_timeout</tt></td>
489
468
  <td>11</td>
490
469
  <td>Number</td>
491
470
  <td><tt>HUTCH_CONNECTION_TIMEOUT</tt></td>
492
- <td><p>Bunny's socket open timeout</p>
493
- </td>
471
+ <td><p>Bunny's socket open timeout</p></td>
494
472
  </tr>
495
-
496
473
  <tr>
497
474
  <td><tt>read_timeout</tt></td>
498
475
  <td>11</td>
499
476
  <td>Number</td>
500
477
  <td><tt>HUTCH_READ_TIMEOUT</tt></td>
501
- <td><p>Bunny's socket read timeout</p>
502
- </td>
478
+ <td><p>Bunny's socket read timeout</p></td>
503
479
  </tr>
504
-
505
480
  <tr>
506
481
  <td><tt>write_timeout</tt></td>
507
482
  <td>11</td>
508
483
  <td>Number</td>
509
484
  <td><tt>HUTCH_WRITE_TIMEOUT</tt></td>
510
- <td><p>Bunny's socket write timeout</p>
511
- </td>
485
+ <td><p>Bunny's socket write timeout</p></td>
512
486
  </tr>
513
-
514
487
  <tr>
515
488
  <td><tt>graceful_exit_timeout</tt></td>
516
489
  <td>11</td>
517
490
  <td>Number</td>
518
491
  <td><tt>HUTCH_GRACEFUL_EXIT_TIMEOUT</tt></td>
519
- <td><p>FIXME: DOCUMENT THIS</p>
520
- </td>
492
+ <td><p>FIXME: DOCUMENT THIS</p></td>
521
493
  </tr>
522
-
523
494
  <tr>
524
495
  <td><tt>consumer_pool_size</tt></td>
525
496
  <td>1</td>
526
497
  <td>Number</td>
527
498
  <td><tt>HUTCH_CONSUMER_POOL_SIZE</tt></td>
528
- <td><p>Bunny consumer work pool size</p>
529
- </td>
499
+ <td><p>Bunny consumer work pool size</p></td>
530
500
  </tr>
531
-
532
501
  <tr>
533
502
  <td><tt>mq_tls</tt></td>
534
503
  <td>false</td>
535
504
  <td>Boolean</td>
536
505
  <td><tt>HUTCH_MQ_TLS</tt></td>
537
- <td><p>Should TLS be used?</p>
538
- </td>
506
+ <td><p>Should TLS be used?</p></td>
539
507
  </tr>
540
-
541
508
  <tr>
542
509
  <td><tt>mq_verify_peer</tt></td>
543
510
  <td>true</td>
544
511
  <td>Boolean</td>
545
512
  <td><tt>HUTCH_MQ_VERIFY_PEER</tt></td>
546
- <td><p>Should SSL certificate be verified?</p>
547
- </td>
513
+ <td><p>Should SSL certificate be verified?</p></td>
548
514
  </tr>
549
-
550
515
  <tr>
551
516
  <td><tt>mq_api_ssl</tt></td>
552
517
  <td>false</td>
553
518
  <td>Boolean</td>
554
519
  <td><tt>HUTCH_MQ_API_SSL</tt></td>
555
- <td><p>Should SSL be used for the RabbitMQ API?</p>
556
- </td>
520
+ <td><p>Should SSL be used for the RabbitMQ API?</p></td>
557
521
  </tr>
558
-
559
522
  <tr>
560
523
  <td><tt>autoload_rails</tt></td>
561
524
  <td>true</td>
562
525
  <td>Boolean</td>
563
526
  <td><tt>HUTCH_AUTOLOAD_RAILS</tt></td>
564
- <td><p>Should the current Rails app directory be required?</p>
565
- </td>
527
+ <td><p>Should the current Rails app directory be required?</p></td>
566
528
  </tr>
567
-
568
529
  <tr>
569
530
  <td><tt>daemonise</tt></td>
570
531
  <td>false</td>
571
532
  <td>Boolean</td>
572
533
  <td><tt>HUTCH_DAEMONISE</tt></td>
573
- <td><p>Should the Hutch runner process daemonise?</p>
574
- </td>
534
+ <td><p>Should the Hutch runner process daemonise?</p></td>
575
535
  </tr>
576
-
577
536
  <tr>
578
537
  <td><tt>publisher_confirms</tt></td>
579
538
  <td>false</td>
580
539
  <td>Boolean</td>
581
540
  <td><tt>HUTCH_PUBLISHER_CONFIRMS</tt></td>
582
- <td><p>Should RabbitMQ publisher confirms be enabled?</p>
583
- </td>
541
+ <td><p>Should RabbitMQ publisher confirms be enabled?</p></td>
584
542
  </tr>
585
-
586
543
  <tr>
587
544
  <td><tt>force_publisher_confirms</tt></td>
588
545
  <td>false</td>
589
546
  <td>Boolean</td>
590
547
  <td><tt>HUTCH_FORCE_PUBLISHER_CONFIRMS</tt></td>
591
- <td><p>Enables publisher confirms, forces Hutch::Broker#wait_for_confirms for</p>
592
- </td>
548
+ <td><p>Enables publisher confirms, forces Hutch::Broker#wait_for_confirms for</p></td>
593
549
  </tr>
594
-
595
550
  <tr>
596
551
  <td><tt>enable_http_api_use</tt></td>
597
552
  <td>true</td>
598
553
  <td>Boolean</td>
599
554
  <td><tt>HUTCH_ENABLE_HTTP_API_USE</tt></td>
600
- <td><p>Should the RabbitMQ HTTP API be used?</p>
601
- </td>
555
+ <td><p>Should the RabbitMQ HTTP API be used?</p></td>
602
556
  </tr>
603
-
604
557
  <tr>
605
558
  <td><tt>consumer_pool_abort_on_exception</tt></td>
606
559
  <td>false</td>
607
560
  <td>Boolean</td>
608
561
  <td><tt>HUTCH_CONSUMER_POOL_ABORT_ON_EXCEPTION</tt></td>
609
- <td><p>Should Bunny's consumer work pool threads abort on exception.</p>
610
- </td>
562
+ <td><p>Should Bunny's consumer work pool threads abort on exception.</p></td>
611
563
  </tr>
612
-
613
564
  <tr>
614
565
  <td><tt>consumer_tag_prefix</tt></td>
615
566
  <td>hutch</td>
616
567
  <td>String</td>
617
568
  <td><tt>HUTCH_CONSUMER_TAG_PREFIX</tt></td>
618
- <td><p>Prefix displayed on the consumers tags.</p>
619
- </td>
569
+ <td><p>Prefix displayed on the consumers tags.</p></td>
620
570
  </tr>
621
-
622
571
  </tbody>
623
572
  </table>
624
573
 
@@ -3,10 +3,10 @@ require File.expand_path('../lib/hutch/version', __FILE__)
3
3
  Gem::Specification.new do |gem|
4
4
  if defined?(JRUBY_VERSION)
5
5
  gem.platform = 'java'
6
- gem.add_runtime_dependency 'march_hare', '>= 2.22.0'
6
+ gem.add_runtime_dependency 'march_hare', '>= 3.0.0'
7
7
  else
8
8
  gem.platform = Gem::Platform::RUBY
9
- gem.add_runtime_dependency 'bunny', '>= 2.6.3'
9
+ gem.add_runtime_dependency 'bunny', '>= 2.7.0'
10
10
  end
11
11
  gem.add_runtime_dependency 'carrot-top', '~> 0.0.7'
12
12
  gem.add_runtime_dependency 'multi_json', '~> 1.12'
@@ -72,8 +72,8 @@ module Hutch
72
72
  end
73
73
  rails_path = File.expand_path(File.join(path, 'config/environment.rb'))
74
74
  if is_rails_app && File.exist?(rails_path)
75
- logger.info "found rails project (#{path}), booting app"
76
75
  ENV['RACK_ENV'] ||= ENV['RAILS_ENV'] || 'development'
76
+ logger.info "found rails project (#{path}), booting app in #{ENV['RACK_ENV']} environment"
77
77
  require rails_path
78
78
  ::Rails.application.eager_load!
79
79
  return true
@@ -3,6 +3,7 @@ require 'honeybadger'
3
3
 
4
4
  module Hutch
5
5
  module ErrorHandlers
6
+ # Error handler for the Honeybadger.io service
6
7
  class Honeybadger
7
8
  include Logging
8
9
 
@@ -11,18 +12,23 @@ module Hutch
11
12
  prefix = "message(#{message_id || '-'}):"
12
13
  logger.error "#{prefix} Logging event to Honeybadger"
13
14
  logger.error "#{prefix} #{ex.class} - #{ex.message}"
14
- ::Honeybadger.notify_or_ignore(
15
- :error_class => ex.class.name,
16
- :error_message => "#{ ex.class.name }: #{ ex.message }",
17
- :backtrace => ex.backtrace,
18
- :context => {
19
- :message_id => message_id,
20
- :consumer => consumer
21
- },
22
- :parameters => {
23
- :payload => payload
24
- }
25
- )
15
+ notify_honeybadger(error_class: ex.class.name,
16
+ error_message: "#{ex.class.name}: #{ex.message}",
17
+ backtrace: ex.backtrace,
18
+ context: { message_id: message_id,
19
+ consumer: consumer },
20
+ parameters: { payload: payload })
21
+ end
22
+
23
+ # Wrap API to support 3.0.0+
24
+ #
25
+ # @see https://github.com/honeybadger-io/honeybadger-ruby/blob/master/CHANGELOG.md#300---2017-02-06
26
+ def notify_honeybadger(message)
27
+ if ::Honeybadger.respond_to?(:notify_or_ignore)
28
+ ::Honeybadger.notify_or_ignore(message)
29
+ else
30
+ ::Honeybadger.notify(message.merge(force: true))
31
+ end
26
32
  end
27
33
  end
28
34
  end
@@ -1,4 +1,4 @@
1
1
  module Hutch
2
- VERSION = '0.24.0'.freeze
2
+ VERSION = '0.25.0-rc1'.freeze
3
3
  end
4
4
 
@@ -30,7 +30,7 @@ describe Hutch::ErrorHandlers::Honeybadger do
30
30
  :payload => payload
31
31
  }
32
32
  }
33
- expect(::Honeybadger).to receive(:notify_or_ignore).with(message)
33
+ expect(error_handler).to receive(:notify_honeybadger).with(message)
34
34
  error_handler.handle(properties, payload, consumer, ex)
35
35
  end
36
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hutch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.0
4
+ version: 0.25.0.pre.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harry Marr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-01 00:00:00.000000000 Z
11
+ date: 2017-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 2.6.3
19
+ version: 2.7.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 2.6.3
26
+ version: 2.7.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: carrot-top
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -167,12 +167,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
167
167
  version: '2.0'
168
168
  required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  requirements:
170
- - - ">="
170
+ - - ">"
171
171
  - !ruby/object:Gem::Version
172
- version: '0'
172
+ version: 1.3.1
173
173
  requirements: []
174
174
  rubyforge_project:
175
- rubygems_version: 2.5.1
175
+ rubygems_version: 2.5.2
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: Easy inter-service communication using RabbitMQ.