sbmt-kafka_consumer 3.1.0 → 3.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 884f55960d86ac5b756f5b7defc30298e6918a543a168f69613972b6f4dd1282
|
4
|
+
data.tar.gz: 4521497f45d7c2bdf7fb78de36ddba7b077a51aee92c5c7aab41057e9b0e1f5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d25efefade51458b46dd3f060983143f9de35d71d7e007dd082daf5f4a6d8a8a635daff400337d38a8621cdda1ad694e115f4816594cb9f94bd408ec8ddd2b9a
|
7
|
+
data.tar.gz: 7fcf377249867d6694515bf006af17de6ade409ddf813bffc63471d437cd1752f659c72d210f071fcf937f6be99f75bf4028e25a3b803d7abfd04e8fd464fdb3
|
data/CHANGELOG.md
CHANGED
@@ -45,9 +45,7 @@ module Sbmt
|
|
45
45
|
|
46
46
|
def with_instrumentation(message)
|
47
47
|
logger.tagged(
|
48
|
-
trace_id: trace_id
|
49
|
-
topic: message.metadata.topic, partition: message.metadata.partition,
|
50
|
-
key: message.metadata.key, offset: message.metadata.offset
|
48
|
+
trace_id: trace_id
|
51
49
|
) do
|
52
50
|
::Sbmt::KafkaConsumer.monitor.instrument(
|
53
51
|
"consumer.consumed_one",
|
@@ -20,30 +20,56 @@ module Sbmt
|
|
20
20
|
|
21
21
|
logger.tagged(
|
22
22
|
type: type,
|
23
|
+
stacktrace: log_backtrace(error),
|
23
24
|
**tags
|
24
25
|
) do
|
25
26
|
logger.error(error_message(error))
|
26
|
-
log_backtrace(error)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
# BaseConsumer events
|
31
31
|
def on_consumer_consumed_one(event)
|
32
|
-
|
32
|
+
log_with_tags(log_tags(event), "Successfully consumed message")
|
33
33
|
end
|
34
34
|
|
35
35
|
def on_consumer_mark_as_consumed(event)
|
36
|
-
|
36
|
+
log_with_tags(log_tags(event), "Processing message")
|
37
37
|
end
|
38
38
|
|
39
39
|
def on_consumer_process_message(event)
|
40
|
-
|
40
|
+
log_with_tags(log_tags(event), "Commit offset")
|
41
41
|
end
|
42
42
|
|
43
43
|
# InboxConsumer events
|
44
44
|
def on_consumer_inbox_consumed_one(event)
|
45
|
-
|
46
|
-
|
45
|
+
log_tags = log_tags(event).merge!(status: event[:status])
|
46
|
+
msg = "Successfully consumed message with uuid: #{event[:message_uuid]}"
|
47
|
+
|
48
|
+
log_with_tags(log_tags, msg)
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
def log_tags(event)
|
54
|
+
metadata = event.payload[:message].metadata
|
55
|
+
|
56
|
+
{
|
57
|
+
kafka: {
|
58
|
+
topic: metadata.topic,
|
59
|
+
partition: metadata.partition,
|
60
|
+
key: metadata.key,
|
61
|
+
offset: metadata.offset,
|
62
|
+
consumer_group: event.payload[:caller].topic.consumer_group.id,
|
63
|
+
consume_duration_ms: event.payload[:time]
|
64
|
+
}
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
def log_with_tags(log_tags, msg)
|
69
|
+
return unless logger.respond_to?(:tagged)
|
70
|
+
|
71
|
+
logger.tagged(log_tags) do
|
72
|
+
logger.send(:info, msg)
|
47
73
|
end
|
48
74
|
end
|
49
75
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sbmt-kafka_consumer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kuper Ruby-Platform Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -565,7 +565,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
565
565
|
- !ruby/object:Gem::Version
|
566
566
|
version: '0'
|
567
567
|
requirements: []
|
568
|
-
rubygems_version: 3.
|
568
|
+
rubygems_version: 3.1.6
|
569
569
|
signing_key:
|
570
570
|
specification_version: 4
|
571
571
|
summary: Ruby gem for consuming Kafka messages
|