rservicebus 0.0.31 → 0.0.32
Sign up to get free protection for your applications and to get access to all the features.
@@ -23,7 +23,7 @@ class Agent_Beanstalk
|
|
23
23
|
@beanstalk.put( serialized_object )
|
24
24
|
end
|
25
25
|
|
26
|
-
# Gives an agent
|
26
|
+
# Gives an agent the means to receive a reply
|
27
27
|
#
|
28
28
|
# @param [String] queueName the name of the queue to monitor for messages
|
29
29
|
def checkForReply( queueName )
|
data/lib/rservicebus/Host.rb
CHANGED
@@ -6,16 +6,16 @@ module RServiceBus
|
|
6
6
|
|
7
7
|
#Host process for rservicebus
|
8
8
|
class Host
|
9
|
-
|
9
|
+
|
10
10
|
@handlerList
|
11
11
|
@resourceByHandlerNameList
|
12
|
-
|
12
|
+
|
13
13
|
@subscriptions
|
14
|
-
|
14
|
+
|
15
15
|
@mq
|
16
|
-
|
16
|
+
|
17
17
|
@appResources
|
18
|
-
|
18
|
+
|
19
19
|
@config
|
20
20
|
|
21
21
|
@subscriptionManager
|
@@ -34,13 +34,13 @@ module RServiceBus
|
|
34
34
|
@appResources = ConfigureAppResource.new.getResources( ENV )
|
35
35
|
return self;
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
def connectToMq
|
39
39
|
@mq = ConfigureMQ.new.get( @config.mqHost + "/" + @config.localQueueName, @config.queueTimeout )
|
40
|
-
|
40
|
+
|
41
41
|
return self
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
#Subscriptions are specified by adding events to the
|
45
45
|
#msg endpoint mapping
|
46
46
|
def sendSubscriptions
|
data/lib/rservicebus/Message.rb
CHANGED
@@ -7,8 +7,8 @@ class Message
|
|
7
7
|
|
8
8
|
# Constructor
|
9
9
|
#
|
10
|
-
# @param [Object] msg The
|
11
|
-
# @param [Object] returnAddress A queue
|
10
|
+
# @param [Object] msg The msg to be sent
|
11
|
+
# @param [Object] returnAddress A queue to which the destination message handler can send replies
|
12
12
|
def initialize( msg, returnAddress )
|
13
13
|
@_msg=YAML::dump(msg)
|
14
14
|
@returnAddress=returnAddress
|
@@ -19,11 +19,14 @@ class Message
|
|
19
19
|
@errorList = Array.new
|
20
20
|
end
|
21
21
|
|
22
|
-
#
|
23
|
-
#
|
22
|
+
# If an error occurs while processing the message, this method allows details of the error to held
|
23
|
+
# next to the msg.
|
24
24
|
#
|
25
|
-
#
|
26
|
-
#
|
25
|
+
# Error(s) are held in an array, which allows current error information to be held, while still
|
26
|
+
# retaining historical error messages.
|
27
|
+
#
|
28
|
+
# @param [Object] sourceQueue The name of the queue to which the msg should be returned
|
29
|
+
# @param [Object] errorString A readible version of what occured
|
27
30
|
def addErrorMsg( sourceQueue, errorString )
|
28
31
|
@errorList << RServiceBus::ErrorMessage.new( sourceQueue, errorString )
|
29
32
|
end
|
@@ -35,6 +38,7 @@ class Message
|
|
35
38
|
return @errorList.last
|
36
39
|
end
|
37
40
|
|
41
|
+
# @return [Object] The msg to be sent
|
38
42
|
def msg
|
39
43
|
return YAML::load( @_msg )
|
40
44
|
end
|
@@ -7,21 +7,34 @@ require "uri"
|
|
7
7
|
class SubscriptionStorage
|
8
8
|
@appName
|
9
9
|
|
10
|
-
#
|
11
|
-
#
|
12
|
-
# @param [String]
|
10
|
+
# Constructor
|
11
|
+
#
|
12
|
+
# @param [String] appName Name of the application, which is used as a Namespace
|
13
|
+
# @param [String] uri a location for the resource to which we will attach, eg redis://127.0.0.1/foo
|
13
14
|
def initialize(appName, uri)
|
14
15
|
@appName = appName
|
15
16
|
end
|
16
17
|
|
18
|
+
# Get a list of all subscription, as an Array
|
19
|
+
#
|
20
|
+
# @param [String] appName Name of the application, which is used as a Namespace
|
21
|
+
# @param [String] uri a location for the resource to which we will attach, eg redis://127.0.0.1/foo
|
17
22
|
def getAll
|
18
23
|
raise "Method, getResource, needs to be implemented for resource"
|
19
24
|
end
|
20
25
|
|
26
|
+
# Add a new subscription
|
27
|
+
#
|
28
|
+
# @param [String] eventName Name of the event for which the subscriber has asked for notification
|
29
|
+
# @param [String] queueName the queue to which the event should be sent
|
21
30
|
def add( eventName, queueName )
|
22
31
|
raise "Method, add, needs to be implemented for this subscription storage"
|
23
32
|
end
|
24
33
|
|
34
|
+
# Remove an existing subscription
|
35
|
+
#
|
36
|
+
# @param [String] eventName Name of the event for which the subscriber has asked for notification
|
37
|
+
# @param [String] queueName the queue to which the event should be sent
|
25
38
|
def remove( eventName, queueName )
|
26
39
|
raise "Method, remove, needs to be implemented for this subscription storage"
|
27
40
|
end
|
@@ -7,6 +7,10 @@ class SubscriptionStorage_Redis<SubscriptionStorage
|
|
7
7
|
|
8
8
|
@redis
|
9
9
|
|
10
|
+
# Constructor
|
11
|
+
#
|
12
|
+
# @param [String] appName Name of the application, which is used as a Namespace
|
13
|
+
# @param [String] uri a location for the resource to which we will attach, eg redis://127.0.0.1/foo
|
10
14
|
def initialize( appName, uri )
|
11
15
|
super(appName, uri)
|
12
16
|
port = uri.port.nil? ? 6379 : uri.port
|
@@ -37,7 +41,6 @@ class SubscriptionStorage_Redis<SubscriptionStorage
|
|
37
41
|
end
|
38
42
|
|
39
43
|
def add( eventName, queueName )
|
40
|
-
# RServiceBus.log "Storing subscrption for, " + eventName + ", to, " + queueName
|
41
44
|
content = @redis.get( @appName + ".Subscriptions" )
|
42
45
|
if content.nil? then
|
43
46
|
subscriptions = Hash.new
|
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.0.
|
4
|
+
version: 0.0.32
|
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: 2012-
|
12
|
+
date: 2012-11-05 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A Ruby interpretation of NServiceBus
|
15
15
|
email: guy@guyirvine.com
|