gorg_message_sender 0.1.1 → 0.2.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/README.md +11 -3
- data/lib/gorg_message_sender/version.rb +1 -1
- data/lib/gorg_message_sender.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc785309b06fc2b58995f9abd052f94759513c52
|
4
|
+
data.tar.gz: 3d4f5e059c7a1e5051347d18bb067f87691260b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbdd689841e327b3781703efab815a2d67066c361e560a50bfb63d666a609d170dd0cf2d69beb3bcf04ce10f3b979c2d7c12147326e7f0ef679f31f585169774
|
7
|
+
data.tar.gz: 41675d6f4324c60ef9234eb78ab0ae31406e2615e634d4f713106200aef11548b8f388638708982158903ae2164796a149c4de1fbdd098370ee60f11754119a9
|
data/README.md
CHANGED
@@ -137,9 +137,17 @@ sender.message({this_is: "my data hash"},
|
|
137
137
|
`send`also accepts the `verbose` params to print sending informations in SDOUT
|
138
138
|
|
139
139
|
```ruby
|
140
|
-
sender.
|
140
|
+
sender.send({this_is: "my data hash"},
|
141
|
+
"some.routing.key",
|
142
|
+
verbose: true
|
143
|
+
)
|
144
|
+
```
|
145
|
+
###Sending a raw message
|
146
|
+
You can also send any raw string with `send_raw`
|
147
|
+
|
148
|
+
```ruby
|
149
|
+
sender.send_raw("my message content",
|
141
150
|
"some.routing.key",
|
142
|
-
event_uuid: "this is not a valid uuid",
|
143
151
|
verbose: true
|
144
152
|
)
|
145
153
|
```
|
@@ -161,4 +169,4 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/Zooip/
|
|
161
169
|
|
162
170
|
## License
|
163
171
|
|
164
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
172
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/lib/gorg_message_sender.rb
CHANGED
@@ -47,6 +47,16 @@ class GorgMessageSender
|
|
47
47
|
msg
|
48
48
|
end
|
49
49
|
|
50
|
+
def send_raw(msg,routing_key,opts={})
|
51
|
+
self.start(verbose: opts[:verbose])
|
52
|
+
p_opts={}
|
53
|
+
p_opts[:routing_key]= routing_key if routing_key
|
54
|
+
@x.publish(msg, p_opts)
|
55
|
+
puts " [#] Message sent to exchange '#{@r_exchange}' (#{@r_durable ? "" : "not "}durable) with routing key '#{routing_key}'" if opts[:verbose]
|
56
|
+
self.stop(verbose: opts[:verbose])
|
57
|
+
msg
|
58
|
+
end
|
59
|
+
|
50
60
|
protected
|
51
61
|
|
52
62
|
def start(opts)
|