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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bff41eec5067fb0fd086111c093e726862bb4c97f421013dcce24bd21e91eb8
|
4
|
+
data.tar.gz: 730fb9c601d9f6f8ad140e744e49996fada071d59f84ea645c93f133152349b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b3e235f2a717eee4ba6ae8cbbce19126295e791b0d2439fd883ae91e387f992192d0666e2e10974be0884aace83f117b30a05d8ed9e05cc69947820e86e4f4e
|
7
|
+
data.tar.gz: c0f8c18450f3a8b9f12035d6e69972c7694f56d04ae9b675a459836fc2ddac8928bf2f81d194a0010536202666eebdb5e24ffa098d731ab0829b0d3d60c0e63a
|
data/Gemfile.lock
CHANGED
@@ -38,13 +38,13 @@ module Messaging
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def log_error(message)
|
41
|
-
if ENV.fetch('KAFKA_LOGGING',
|
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',
|
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.
|
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
|