govuk_message_queue_consumer 4.0.0 → 4.1.0

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
  SHA256:
3
- metadata.gz: 2ff831021fdec8b26b02d2a1b9c36d5b35499a617e6c43995bb1dea97710d62e
4
- data.tar.gz: 68fb8c56450889fd41def5ce02fd520a6e5d4ead28f738688ebb26a351769e05
3
+ metadata.gz: cc0734bab51ff11acbfbb49e0e750f1dc572597dc022ba914ca3bf3fe1d056a8
4
+ data.tar.gz: 737af6b51e95e3e9295c66a03485c9f98ba9aaf34c907829c217c88d7d1d54ac
5
5
  SHA512:
6
- metadata.gz: ccd4008cf70e0a1edb4ff3e1712233518bed5321c7ed5531853a8336d596ecf06ba645a1b65b4071a0fcf7b77885f0c6ed4200f26eb2c8284e7f4d14834d18cb
7
- data.tar.gz: 0dc0f62ca439285e225f0cf3b0261158ffc3444339c765937077759e4565134618488826b8547b255bdbc92d41a04c392154ff50b9919ede2a8405f1f26c9862
6
+ metadata.gz: bf52f103daa4c105e0d8efb84b597ae3fa6e7354b391457b1d984bcf53132b70dc03ca4aca0b02bf63c7dc51d1f8c42f399880b4e433800db0307171f6b02822
7
+ data.tar.gz: 9527d48f2fe4bd59b068a666359c2d949cc2f7bcee0b5f4e745d9fd10fe8eea25fb6504ab151dbd7e3ab251f21c71a74084e09f5bd817e4cef3704f65a5971a8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ # 4.1.0
2
+
3
+ - Support configuration via
4
+ [`RABBITMQ_URL`](https://github.com/ruby-amqp/bunny/blob/066496d8/docs/guides/connecting.md#the-rabbitmq_url-environment-variable)
5
+ instead of `RABBITMQ_HOSTS`, `RABBITMQ_VHOST`, `RABBITMQ_USER` and
6
+ `RABBITMQ_PASSWORD`, which are deprecated and will be removed in a later
7
+ version.
8
+ - Update [bunny](https://github.com/ruby-amqp/bunny/) from 2.11 to 2.17, which
9
+ is the last version that supports Ruby 2.7. See [Bunny
10
+ changelog](https://github.com/ruby-amqp/bunny/blob/main/ChangeLog.md#changes-between-bunny-216x-and-2170-sep-11th-2020).
11
+
1
12
  # 4.0.0
2
13
 
3
14
  - Breaking: remove batch consumer ([#73](https://github.com/alphagov/govuk_message_queue_consumer/pull/73))
data/README.md CHANGED
@@ -57,15 +57,15 @@ end
57
57
 
58
58
  More options are [documented here](http://www.rubydoc.info/gems/govuk_message_queue_consumer/GovukMessageQueueConsumer/Consumer#initialize-instance_method).
59
59
 
60
- The consumer expects a number of environment variables to be present. On GOV.UK,
61
- these should be set up in puppet.
60
+ The consumer expects the [`RABBITMQ_URL` environment
61
+ variable](https://github.com/ruby-amqp/bunny/blob/066496d/docs/guides/connecting.md#paas-environments)
62
+ to be set to an AMQP connection string, for example:
62
63
 
63
- ```
64
- RABBITMQ_HOSTS=rabbitmq1.example.com,rabbitmq2.example.com
65
- RABBITMQ_VHOST=/
66
- RABBITMQ_USER=a_user
67
- RABBITMQ_PASSWORD=a_super_secret
68
- ```
64
+ `RABBITMQ_URL=amqp://mrbean:hunter2@rabbitmq.example.com:5672`
65
+
66
+ The GOV.UK-specific environment variables `RABBITMQ_HOSTS`, `RABBITMQ_VHOST`,
67
+ `RABBITMQ_USER` and `RABBITMQ_PASSWORD` are deprecated. Support for these will
68
+ be removed in a future version of govuk_message_queue_consumer.
69
69
 
70
70
  Define a class that will process the messages:
71
71
 
@@ -11,7 +11,12 @@ module GovukMessageQueueConsumer
11
11
  NUMBER_OF_MESSAGES_TO_PREFETCH = 1
12
12
 
13
13
  def self.default_connection_from_env
14
- Bunny.new(GovukMessageQueueConsumer::RabbitMQConfig.from_environment(ENV))
14
+ # https://github.com/ruby-amqp/bunny/blob/066496d/docs/guides/connecting.md#paas-environments
15
+ if !ENV["RABBITMQ_URL"].to_s.empty?
16
+ Bunny.new
17
+ else
18
+ Bunny.new(RabbitMQConfig.from_environment(ENV))
19
+ end
15
20
  end
16
21
 
17
22
  # Create a new consumer
@@ -9,7 +9,6 @@ module GovukMessageQueueConsumer
9
9
  vhost: fetch(env, "RABBITMQ_VHOST"),
10
10
  user: fetch(env, "RABBITMQ_USER"),
11
11
  pass: fetch(env, "RABBITMQ_PASSWORD"),
12
- recover_from_connection_close: true,
13
12
  }
14
13
  end
15
14
 
@@ -22,7 +21,9 @@ module GovukMessageQueueConsumer
22
21
  The environment variable #{variable_name} is not set. If you are in test
23
22
  mode, make sure you set the correct vars in your helpers. If you get this
24
23
  error in development, make sure you run rails or rake with `govuk_setenv`
25
- and puppet is up to date.
24
+ and puppet is up to date. RABBITMQ_HOSTS, RABBITMQ_VHOST,
25
+ RABBITMQ_USER and RABBITMQ_PASSWORD are deprecated. Please switch to
26
+ RABBITMQ_URL.
26
27
  ERR
27
28
  end
28
29
  end
@@ -1,3 +1,3 @@
1
1
  module GovukMessageQueueConsumer
2
- VERSION = "4.0.0".freeze
2
+ VERSION = "4.1.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_message_queue_consumer
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-23 00:00:00.000000000 Z
11
+ date: 2022-12-14 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.11'
19
+ version: '2.17'
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.11'
26
+ version: '2.17'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bunny-mock
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 4.7.0
89
+ version: 4.9.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 4.7.0
96
+ version: 4.9.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: yard
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  - !ruby/object:Gem::Version
149
149
  version: '0'
150
150
  requirements: []
151
- rubygems_version: 3.3.22
151
+ rubygems_version: 3.3.26
152
152
  signing_key:
153
153
  specification_version: 4
154
154
  summary: AMQP message queue consumption with GOV.UK conventions