jackhammer 1.2.0 → 1.3.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: b05bbadd40bdcdbf69d7ed079f5da3b5ef7494e5cfab42288b0e114aa1effb7c
4
- data.tar.gz: 4db8060a85601dae226889a134531c48bf4b2b389b399f9bf782985f6909dd03
3
+ metadata.gz: b3233e5bc59da2462018ba8fce8316c164a98b67de74febd54adb5eb947ea791
4
+ data.tar.gz: 1cc3cc86e29fd9f053b35be5ccfb5b3e60c0a6513f049d39c7c725fdf2cc103d
5
5
  SHA512:
6
- metadata.gz: 3685542942aa0dcb6568bfa408a44015eeeade76268f610bd7a119feb8d6092e6c588dc846c7699325646ca86e6e242c7935b5eac1efa2e6334bdef1bfafcdd2
7
- data.tar.gz: 16300121a91938775bf6f4a6e7e89cae0a4764653fc64e4e92f8c7a655be7e2953ff8a473a95f8d5205909150ac2226a641c7c687b06f30abff8e412c87a919e
6
+ metadata.gz: d35d51ed2ed012671cd41035f417e161d5ecdb1c44a01e6c27c0c880e967de30d5c04900a517cddceb93987e7f4ad091e07e11a1b62a09f6893d70d2a8f86c88
7
+ data.tar.gz: 85720d119ebbde35fbb0f05fb57058f7afe8251f7942891ccfd8765503cd022cb2ea3a376ac73cb978dda66dc16358b9462884e1589d46e218d41b3346065dc3
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jackhammer (1.2.0)
4
+ jackhammer (1.3.0)
5
5
  bunny (~> 2.14)
6
6
 
7
7
  GEM
@@ -37,5 +37,14 @@ module Jackhammer
37
37
  def topics
38
38
  @topics ||= TopicManager.topics
39
39
  end
40
+
41
+ def publish_options(options = {}, time: Time.now.utc)
42
+ configuration.publish_options.dup.merge(options).tap do |opts|
43
+ opts[:timestamp] = time.to_i
44
+ opts[:app_id] ||= configuration.app_name
45
+ opts[:headers] ||= {}
46
+ opts[:headers][:time] ||= time.iso8601
47
+ end
48
+ end
40
49
  end
41
50
  end
@@ -15,8 +15,7 @@ module Jackhammer
15
15
  # We're expecting the client to specify at least the routing_key in options
16
16
  # for each message published.
17
17
  def publish(message, options)
18
- full_options = Jackhammer.configuration.publish_options.dup.merge options
19
- topic.publish message, full_options
18
+ topic.publish message, Jackhammer.publish_options(options)
20
19
  end
21
20
 
22
21
  def queues
@@ -1,3 +1,3 @@
1
1
  module Jackhammer
2
- VERSION = '1.2.0'.freeze
2
+ VERSION = '1.3.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jackhammer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Serok
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-29 00:00:00.000000000 Z
11
+ date: 2020-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny