nats_messaging 1.2.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 +4 -4
- metadata +1 -1
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,17 +52,16 @@ 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
|
-
|
57
|
+
@subscriptions[subject] = @js.subscribe(subject, durable: durable_name) do |msg|
|
58
58
|
unpacked_data = process_received_message(msg, subject)
|
59
59
|
end
|
60
60
|
else
|
61
|
-
|
61
|
+
@subscriptions[subject] = @nats.subscribe(subject) do |msg|
|
62
62
|
unpacked_data = process_received_message(msg, subject)
|
63
63
|
end
|
64
64
|
end
|
65
|
-
@subscriptions[subject] = subscription
|
66
65
|
unpacked_data
|
67
66
|
end
|
68
67
|
|
@@ -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}"
|