nats_messaging 1.2.8 → 1.3.0
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 +3 -4
- 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: 85ff48cb51b0c9bfc615d5c2f8e9a555a64ff08d264e7273d27f521b94b4c4da
|
4
|
+
data.tar.gz: 4162a4cbfd74d39ec9af5a4f4a5cbf5e80e3635439be570f5263f44adba633cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2452efb96a79d7eaba51826b634b3a8917b00a1a4f7942c150b5f538a34108f60735e8e3df31bfca5b2b473c24917cfa017e36353fc42fab33795212d0959e5b
|
7
|
+
data.tar.gz: 28358eb8aad977fdb708061be7b1090d39ef097f52ede12bf2b0018feb18c95e40dc7a0666089f84e1bb9a9a372f3988e2ee17e783b5072c878b201fa40f9c54
|
@@ -103,7 +103,6 @@ module NatsMessaging
|
|
103
103
|
if @subscriptions[subject]
|
104
104
|
@subscriptions[subject].unsubscribe
|
105
105
|
end
|
106
|
-
unpacked_data = nil
|
107
106
|
begin
|
108
107
|
# Create a new subscription
|
109
108
|
puts "NATS: Listening on #{subject} with reply message: #{reply_message}"
|
@@ -112,12 +111,12 @@ module NatsMessaging
|
|
112
111
|
unpacked_data = MessagePack.unpack(msg.data) # Deserializar mensaje recibido
|
113
112
|
puts "NATS: Received request on #{subject}: #{unpacked_data}"
|
114
113
|
yield_return = yield(subject, unpacked_data) if block_given?
|
115
|
-
|
116
|
-
packed_reply =
|
114
|
+
reply = reply_message.nil? ? yield_return : reply_message
|
115
|
+
packed_reply = reply.to_msgpack # Serializar respuesta
|
117
116
|
# Asegurar que msg.reply existe antes de responder
|
118
117
|
if msg.reply
|
119
118
|
@nats.publish(msg.reply, packed_reply)
|
120
|
-
puts "NATS: Replied to #{subject} with message: #{
|
119
|
+
puts "NATS: Replied to #{subject} with message: #{reply}"
|
121
120
|
else
|
122
121
|
puts "NATS: No reply subject for #{subject}, cannot respond"
|
123
122
|
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.3.0
|
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-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nats-pure
|