twingly-amqp 6.0.0 → 6.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: 2cfce02de5ea28c844564b13473a31afd438dbc2001392092902666da3a8721a
4
- data.tar.gz: 05db74046a863f23a0e541cc60402e0f3ae91e5ca6e01131e8aa16c0cc15fc29
3
+ metadata.gz: 72327e797eeb0baacb83fa4a8680f6108a2cacdc6aa1185bbd3dfd855a1738c9
4
+ data.tar.gz: a0fee780601c0d0bed3afa6f4a70e99fe775c09c3f72b8674f5ac840103252c5
5
5
  SHA512:
6
- metadata.gz: 556a43b0b4229225828678fe9f23f3912e39e7a8ec72f6fd2a549cfbd6db7dfa6043aa1f3e0f23998a5fea38f329fb110a3904db84ddd16a8657aad21a3a2d1a
7
- data.tar.gz: fb0b7fa69facd940accfabbab125ae116d20101f9e33e87b010087d800687c21953a52983035c66bcc95e58fae2ba0ba78b529ba7d398680b56e405129d82b19
6
+ metadata.gz: 3d7692b89922e73d8c9056a863f5039371c4ac1962d2419fe5144d00f553ad343b989d3dcc70e727902f3a3c3dc6ad981a6de0cdacd9cb189295413a5b7428ca
7
+ data.tar.gz: d50510058e01960b482712b3719182ca32a88854c0ded35c967b91cca087cd083f37ac67e892c9f960ca0fc6d00da73ab3792cc9f38bf5d0347db91ffe7d3f41
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Twingly::AMQP
2
2
 
3
- [![GitHub Build Status](https://github.com/twingly/twingly-amqp/workflows/CI/badge.svg?branch=master)](https://github.com/twingly/twingly-amqp/actions)
3
+ [![GitHub Build Status](https://github.com/twingly/twingly-amqp/workflows/CI/badge.svg)](https://github.com/twingly/twingly-amqp/actions)
4
4
 
5
5
  A gem for subscribing and publishing messages via RabbitMQ.
6
6
 
@@ -132,6 +132,9 @@ publisher.configure_publish_options do |options|
132
132
  end
133
133
 
134
134
  publisher.publish({ my: "data" })
135
+
136
+ publisher.publish({ my: "other_data" }, routing_key: "my_other_key") # Override routing_key or other publishing options
137
+ # accepted by Bunny::Exchange#publish
135
138
  ```
136
139
 
137
140
  ### Publish delayed messages
@@ -1,7 +1,7 @@
1
1
  module Twingly
2
2
  module AMQP
3
3
  module Publisher
4
- def publish(message)
4
+ def publish(message, opts = {})
5
5
  payload =
6
6
  if message.kind_of?(Array)
7
7
  message
@@ -11,17 +11,17 @@ module Twingly
11
11
  raise ArgumentError
12
12
  end
13
13
 
14
- json_payload = payload.to_json
15
- opts = options.to_h
16
- @exchange.publish(json_payload, opts)
14
+ json_payload = payload.to_json
15
+ publishing_options = options.to_h.merge(opts)
16
+ @exchange.publish(json_payload, publishing_options)
17
17
  end
18
18
 
19
19
  # Only used by tests to lessen the time we need to sleep
20
- def publish_with_confirm(message)
20
+ def publish_with_confirm(message, opts = {})
21
21
  channel = @exchange.channel
22
22
  channel.confirm_select unless channel.using_publisher_confirmations?
23
23
 
24
- publish(message)
24
+ publish(message, opts)
25
25
 
26
26
  @exchange.wait_for_confirms
27
27
  end
@@ -1,5 +1,5 @@
1
1
  module Twingly
2
2
  module Amqp
3
- VERSION = "6.0.0".freeze
3
+ VERSION = "6.1.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twingly-amqp
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Twingly AB
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-13 00:00:00.000000000 Z
11
+ date: 2023-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny