nats_messaging 1.1.1 → 1.2.2
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 +4 -4
- data/lib/nats_messaging/nats_service.rb +8 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7b21372d836c43259a490f38b4a55300847119e9ed4271b33ac3437b13fa453
|
4
|
+
data.tar.gz: a71b99c8a0aa0d2f3dad4ea186c32d86d9223fcb1eda4940634c077c90624530
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da0a0c37208a95df4b8758750bafc817045aeb5729697a52f9e9e8ab3f8cdc7526308672da58258919d7de513f3d1a37a387e894545d0e210a09037c953ff843
|
7
|
+
data.tar.gz: 20dc197be7c4e9de81cf8db9a73203aa41a6a4d00b93ee3bb5f65e39aad7d6c7f718a479d9d5ace5aff78cc233fab821ee1210bdaa2a196034eee331f11f2437
|
@@ -52,18 +52,17 @@ module NatsMessaging
|
|
52
52
|
# Subscribe to a subject using MessagePack
|
53
53
|
def subscribe_to_subject(subject, durable_name = "durable_name")
|
54
54
|
puts "NATS: Subscribing to #{subject}"
|
55
|
-
|
55
|
+
unpacked_data = nil
|
56
56
|
if @js
|
57
|
-
|
58
|
-
process_received_message(msg, subject)
|
57
|
+
@subscriptions[subject] = @js.subscribe(subject, durable: durable_name) do |msg|
|
58
|
+
unpacked_data = process_received_message(msg, subject)
|
59
59
|
end
|
60
60
|
else
|
61
|
-
|
62
|
-
process_received_message(msg, subject)
|
61
|
+
@subscriptions[subject] = @nats.subscribe(subject) do |msg|
|
62
|
+
unpacked_data = process_received_message(msg, subject)
|
63
63
|
end
|
64
64
|
end
|
65
|
-
|
66
|
-
@subscriptions[subject] = subscription
|
65
|
+
unpacked_data
|
67
66
|
end
|
68
67
|
|
69
68
|
# Process received message
|
@@ -101,6 +100,7 @@ module NatsMessaging
|
|
101
100
|
if @subscriptions[subject]
|
102
101
|
@subscriptions[subject].unsubscribe
|
103
102
|
end
|
103
|
+
unpacked_data = nil
|
104
104
|
begin
|
105
105
|
# Create a new subscription
|
106
106
|
puts "NATS: Suscribing to #{subject}"
|
@@ -127,6 +127,7 @@ module NatsMessaging
|
|
127
127
|
# Store the new subscription in the hash
|
128
128
|
@subscriptions[subject] = subscription
|
129
129
|
puts "NATS: Listening on #{subject} with reply message: #{reply_message}"
|
130
|
+
unpacked_data
|
130
131
|
end
|
131
132
|
end
|
132
133
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nats_messaging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bea Graboloza
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-04-
|
11
|
+
date: 2025-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nats-pure
|