messaging-stash 0.1.7 → 0.1.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 435e1de1f5bfc83c5cd2d9b004d1a2a2ff995d42ec4288d59279b82468e2716e
4
- data.tar.gz: b01627634ba18c3b9901df2a64d8432901401bde931cad1aeac0697769faaddb
3
+ metadata.gz: 7bff41eec5067fb0fd086111c093e726862bb4c97f421013dcce24bd21e91eb8
4
+ data.tar.gz: 730fb9c601d9f6f8ad140e744e49996fada071d59f84ea645c93f133152349b4
5
5
  SHA512:
6
- metadata.gz: 031e0c9b3eb10ca207f8666de56e72299dacf762c7cc4fac6975dc316bca29dc5c5f014d91254483895c574435293c9b3494d41344f6cf0cb3f739ece0e91fb2
7
- data.tar.gz: 93d0f59f036589e658c6c0628393b7ed81f72ec2b5db339fc9f9b58c24bc02d2a1aa7dfbbe6ed0a6f94a3269451e90afc3dbeda50e759cfe5194896836848b6c
6
+ metadata.gz: 8b3e235f2a717eee4ba6ae8cbbce19126295e791b0d2439fd883ae91e387f992192d0666e2e10974be0884aace83f117b30a05d8ed9e05cc69947820e86e4f4e
7
+ data.tar.gz: c0f8c18450f3a8b9f12035d6e69972c7694f56d04ae9b675a459836fc2ddac8928bf2f81d194a0010536202666eebdb5e24ffa098d731ab0829b0d3d60c0e63a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- messaging-stash (0.1.5)
4
+ messaging-stash (0.1.7)
5
5
  activesupport (>= 5.2.0)
6
6
  phobos (= 1.7.1)
7
7
  ruby-kafka (= 0.5.5)
@@ -65,4 +65,4 @@ DEPENDENCIES
65
65
  rspec (~> 3.0)
66
66
 
67
67
  BUNDLED WITH
68
- 1.16.1
68
+ 1.16.2
@@ -38,13 +38,13 @@ module Messaging
38
38
  end
39
39
 
40
40
  def log_error(message)
41
- if ENV.fetch('KAFKA_LOGGING', false)
41
+ if ENV.fetch('KAFKA_LOGGING', true)
42
42
  logger.error(message)
43
43
  end
44
44
  end
45
45
 
46
46
  def log_info(message)
47
- if ENV.fetch('KAFKA_LOGGING', false)
47
+ if ENV.fetch('KAFKA_LOGGING', true)
48
48
  logger.info(message)
49
49
  end
50
50
  end
@@ -23,7 +23,7 @@ module Messaging
23
23
  if metadata[:retry_count] > ERROR_THRESHOLD
24
24
  # move the message to the poison topic if the threshold is reached.
25
25
  message = Messaging::Messages::Events::MessagePoisoned.new(payload: payload_hash, listener: metadata[:handler], error_message: e.message)
26
- Messaging::Kafka::MessageSender.publish(message)
26
+ Messaging::Kafka::MessageSender.async_publish(message)
27
27
  else
28
28
  raise
29
29
  end
@@ -10,7 +10,6 @@ module Messaging
10
10
  # A publish failure will not retry.
11
11
  # Use sparingly.
12
12
  def publish(message)
13
- return unless publish_message?
14
13
  begin
15
14
  producer.publish(message.topic, message.body_json)
16
15
  rescue => e
@@ -22,7 +21,6 @@ module Messaging
22
21
  # A publish_list failure will not retry.
23
22
  # Use sparingly.
24
23
  def publish_list(messages)
25
- return unless publish_message?
26
24
  begin
27
25
  message_list = build_messages(messages)
28
26
  producer.publish_list(message_list)
@@ -34,14 +32,12 @@ module Messaging
34
32
  # .async_publish will buffer a message to be sent according to the asynchronous delivery configuration.
35
33
  # This method will return immediately.
36
34
  def async_publish(message)
37
- return unless publish_message?
38
35
  async_publish_list([message])
39
36
  end
40
37
 
41
38
  # .async_publish_list will buffer a message to be sent according to the asynchronous delivery configuration.
42
39
  # This method will return immediately.
43
40
  def async_publish_list(messages)
44
- return unless publish_message?
45
41
  message_list = build_messages(messages)
46
42
  init_async_producer
47
43
  producer.async_publish_list(message_list)
@@ -76,11 +72,6 @@ module Messaging
76
72
  end
77
73
  end
78
74
 
79
- def publish_message?
80
- true
81
- # Flipper.enabled?(:publish_messages_to_kafka)
82
- end
83
-
84
75
  # A list of Phobos created asynchronous producers.
85
76
  # This is an array of Kafka::AsyncProducer from the ruby-kafka gem.
86
77
  def async_producers
@@ -1,5 +1,5 @@
1
1
  module Messaging
2
2
  module Stash
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: messaging-stash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Kaufman