rservicebus 0.1.13 → 0.1.14
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.
@@ -1,6 +1,10 @@
|
|
1
1
|
module RServiceBus
|
2
2
|
require 'beanstalk-client'
|
3
3
|
|
4
|
+
class QueueNotFoundForMsg<StandardError
|
5
|
+
end
|
6
|
+
|
7
|
+
|
4
8
|
#A means for a stand-alone process to interact with the bus, without being a full
|
5
9
|
#rservicebus application
|
6
10
|
class Agent_Beanstalk
|
@@ -16,6 +20,8 @@ class Agent_Beanstalk
|
|
16
20
|
# @param [String] queueName the name of the queue to be send the msg to
|
17
21
|
# @param [String] returnAddress the name of a queue to send replies to
|
18
22
|
def sendMsg(messageObj, queueName, returnAddress=nil)
|
23
|
+
raise QueueNotFoundForMsg.new( messageObj.class.name ) if queueName.nil?
|
24
|
+
|
19
25
|
msg = RServiceBus::Message.new( messageObj, returnAddress )
|
20
26
|
|
21
27
|
|
@@ -42,7 +42,13 @@ module RServiceBus
|
|
42
42
|
|
43
43
|
agent = RServiceBus::Agent.new.getAgent( URI.parse( "beanstalk://127.0.0.1:11300" ) )
|
44
44
|
agent.sendMsg(msg, queueName, responseQueue)
|
45
|
-
|
45
|
+
|
46
|
+
rescue QueueNotFoundForMsg=>e
|
47
|
+
msg = "\n"
|
48
|
+
msg = "#{msg}*** Queue not found for, #{e.message}\n"
|
49
|
+
msg = "#{msg}*** Ensure you have an environment variable set for this Message Type, eg, \n"
|
50
|
+
msg = "#{msg}*** MESSAGE_ENDPOINT_MAPPINGS=#{e.message}:<QueueName>\n"
|
51
|
+
raise StandardError.new( msg )
|
46
52
|
end
|
47
53
|
|
48
54
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rservicebus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-03 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A Ruby interpretation of NServiceBus
|
15
15
|
email: guy@guyirvine.com
|