nats_messaging 0.1.3 → 0.1.4
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 -5
- 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: c271c8462940136b7322b2ac28de856047f6f8523ca68af72d233a8910abe38b
|
4
|
+
data.tar.gz: 45f1f8033b7dad2604a826ce31cb63c0e14ec479240911fbcb4e6e2b6cf22846
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3fb1e18f055a532bdaee67481496446b4c4e663c3c900f8cb272dbb47edd7afbc046be853c90f5f7358353b0c22e3d48779fc4da018048834f7ab3d5f0367f2
|
7
|
+
data.tar.gz: 9ef4411381291bc7ebb52146287ff33ca0720a44a8bb781a335402daaf88c053a49d95582eaf42b63b32b207f82fffad329c1fdd360fc8a565225a61e94406bb
|
@@ -82,11 +82,14 @@ module NatsMessaging
|
|
82
82
|
Rails.logger.info "Suscribing a #{subject}"
|
83
83
|
puts "Suscribing a #{subject}"
|
84
84
|
subscription = @nats.subscribe(subject) do |msg|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
85
|
+
# Asegurar que msg.reply existe antes de responder
|
86
|
+
if msg.reply
|
87
|
+
@nats.publish(msg.reply, reply_message)
|
88
|
+
Rails.logger.info "Replied to #{subject} with message: #{reply_message}"
|
89
|
+
puts "Replied to #{subject} with message: #{reply_message}"
|
90
|
+
else
|
91
|
+
Rails.logger.error "No reply subject for #{subject}, cannot respond"
|
92
|
+
end
|
90
93
|
end
|
91
94
|
rescue => e
|
92
95
|
Rails.logger.error "Error while replying: #{e.message}"
|