rservicebus 0.1.50 → 0.1.52
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rservicebus/Agent.rb +1 -1
- data/lib/rservicebus/AppResource.rb +1 -1
- data/lib/rservicebus/ConfigureMonitor.rb +2 -2
- data/lib/rservicebus/CronManager.rb +2 -2
- data/lib/rservicebus/EndpointMapping.rb +1 -1
- data/lib/rservicebus/HandlerLoader.rb +4 -4
- data/lib/rservicebus/HandlerManager.rb +14 -14
- data/lib/rservicebus/Host.rb +10 -10
- data/lib/rservicebus/Monitor/Dir.rb +4 -4
- data/lib/rservicebus/Transporter.rb +15 -22
- data/lib/rservicebus/helper_functions.rb +29 -17
- metadata +12 -12
data/lib/rservicebus/Agent.rb
CHANGED
@@ -12,7 +12,7 @@ end
|
|
12
12
|
def getAgent( uri )
|
13
13
|
ENV["RSBMQ"] = uri.to_s
|
14
14
|
|
15
|
-
RServiceBus.
|
15
|
+
RServiceBus.rlog "*** Agent.getAgent has been deprecated. Set the environment variable, RSBMQ, and simply create the class"
|
16
16
|
return Agent.new
|
17
17
|
end
|
18
18
|
|
@@ -17,7 +17,7 @@ module RServiceBus
|
|
17
17
|
|
18
18
|
def _connect
|
19
19
|
@connection = self.connect(@uri)
|
20
|
-
|
20
|
+
RServiceBus.rlog "#{self.class.name}. Connected to, #{@uri.to_s}"
|
21
21
|
end
|
22
22
|
|
23
23
|
# Resources are attached resources, and can be specified using the URI syntax.
|
@@ -25,8 +25,8 @@ module RServiceBus
|
|
25
25
|
# @param [RServiceBus::Handler] handler
|
26
26
|
## @param [Hash] appResources As hash[k,v] where k is the name of a resource, and v is the resource
|
27
27
|
def setAppResources( monitor )
|
28
|
-
|
29
|
-
|
28
|
+
RServiceBus.rlog "Checking app resources for: #{monitor.class.name}"
|
29
|
+
RServiceBus.rlog "If your attribute is not getting set, check that it is in the 'attr_accessor' list"
|
30
30
|
@appResources.each do |k,v|
|
31
31
|
if monitor.class.method_defined?( k ) then
|
32
32
|
monitor.instance_variable_set( "@#{k}", v.getResource() )
|
@@ -55,7 +55,7 @@ class CronManager
|
|
55
55
|
@Bus = host
|
56
56
|
@msgNames = msgNames
|
57
57
|
|
58
|
-
|
58
|
+
RServiceBus.rlog "Load Cron"
|
59
59
|
@list = Array.new
|
60
60
|
ENV.each do |k,v|
|
61
61
|
if k.start_with?( "RSBCRON_" ) then
|
@@ -75,7 +75,7 @@ class CronManager
|
|
75
75
|
now = Time.now
|
76
76
|
@list.each_with_index do |v,idx|
|
77
77
|
if now > v['next'] then
|
78
|
-
|
78
|
+
RServiceBus.rlog "CronManager.Send, #{v['name']}"
|
79
79
|
@Bus.Send( RServiceBus.createAnonymousClass( v['name'] ) )
|
80
80
|
@list[idx]['next'] = v['cron'].next(now)
|
81
81
|
end
|
@@ -23,7 +23,7 @@ module RServiceBus
|
|
23
23
|
exit()
|
24
24
|
end
|
25
25
|
|
26
|
-
|
26
|
+
RServiceBus.rlog "EndpointMapping.configureMapping: #{match[1]}, #{match[2]}"
|
27
27
|
@endpoints[match[1]] = match[2]
|
28
28
|
|
29
29
|
@queueNameList.each do |q|
|
@@ -79,16 +79,16 @@ class HandlerLoader
|
|
79
79
|
# @returns [RServiceBus::Handler] handler
|
80
80
|
def loadHandler(msgName, filePath, handlerName)
|
81
81
|
if @listOfLoadedPaths.has_key?( filePath ) then
|
82
|
-
|
82
|
+
RServiceBus.log "Not reloading, #{filePath}"
|
83
83
|
return
|
84
84
|
end
|
85
85
|
|
86
86
|
begin
|
87
|
-
|
88
|
-
|
87
|
+
RServiceBus.rlog "filePath: " + filePath
|
88
|
+
RServiceBus.rlog "handlerName: " + handlerName
|
89
89
|
|
90
90
|
handler = self.loadHandlerFromFile( handlerName, filePath )
|
91
|
-
|
91
|
+
RServiceBus.log "Loaded Handler: " + handlerName
|
92
92
|
|
93
93
|
@handlerManager.addHandler( msgName, handler )
|
94
94
|
|
@@ -26,7 +26,7 @@ module RServiceBus
|
|
26
26
|
def setBusAttributeIfRequested( handler )
|
27
27
|
if defined?( handler.Bus ) then
|
28
28
|
handler.Bus = @host
|
29
|
-
|
29
|
+
RServiceBus.log "Bus attribute set for: " + handler.class.name
|
30
30
|
end
|
31
31
|
|
32
32
|
return self
|
@@ -38,7 +38,7 @@ module RServiceBus
|
|
38
38
|
def setStateAttributeIfRequested( handler )
|
39
39
|
if defined?( handler.State ) then
|
40
40
|
handler.State = @stateManager.Get( handler )
|
41
|
-
|
41
|
+
RServiceBus.log "Bus attribute set for: " + handler.class.name
|
42
42
|
end
|
43
43
|
|
44
44
|
return self
|
@@ -54,14 +54,14 @@ module RServiceBus
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def interrogateHandlerForAppResources( handler )
|
57
|
-
|
58
|
-
|
57
|
+
RServiceBus.rlog "Checking app resources for: #{handler.class.name}"
|
58
|
+
RServiceBus.rlog "If your attribute is not getting set, check that it is in the 'attr_accessor' list"
|
59
59
|
|
60
60
|
@resourceListByHandlerName[handler.class.name] = Array.new
|
61
61
|
@appResources.each do |k,v|
|
62
62
|
if handler.class.method_defined?( k ) then
|
63
63
|
@resourceListByHandlerName[handler.class.name] << k
|
64
|
-
|
64
|
+
RServiceBus.log "Resource attribute, #{k}, found for: " + handler.class.name
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -83,14 +83,14 @@ module RServiceBus
|
|
83
83
|
# @param [RServiceBus::Handler] handler
|
84
84
|
## @param [Hash] appResources As hash[k,v] where k is the name of a resource, and v is the resource
|
85
85
|
def setAppResources_to_be_removed( handler )
|
86
|
-
|
87
|
-
|
86
|
+
RServiceBus.rlog "Checking app resources for: #{handler.class.name}"
|
87
|
+
RServiceBus.rlog "If your attribute is not getting set, check that it is in the 'attr_accessor' list"
|
88
88
|
@appResources.each do |k,v|
|
89
89
|
if handler.class.method_defined?( k ) then
|
90
90
|
v._connect
|
91
91
|
# v.Begin
|
92
92
|
handler.instance_variable_set( "@#{k}", v.getResource() )
|
93
|
-
|
93
|
+
RServiceBus.log "App resource attribute, #{k}, set for: " + handler.class.name
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
@@ -114,7 +114,7 @@ module RServiceBus
|
|
114
114
|
next if @resourceListByHandlerName[handler.class.name].nil?
|
115
115
|
@resourceListByHandlerName[handler.class.name].each do |k|
|
116
116
|
handler.instance_variable_set( "@#{k}", @appResources[k].getResource() )
|
117
|
-
|
117
|
+
RServiceBus.rlog "App resource attribute, #{k}, set for: " + handler.class.name
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
@@ -129,7 +129,7 @@ module RServiceBus
|
|
129
129
|
r = @appResources[resourceName]
|
130
130
|
r._connect
|
131
131
|
r.Begin
|
132
|
-
|
132
|
+
RServiceBus.rlog "Preparing resource: #{resourceName}. Begin"
|
133
133
|
end
|
134
134
|
|
135
135
|
self.setResourcesForHandlersNeededToProcessMsg( msgName )
|
@@ -138,11 +138,11 @@ module RServiceBus
|
|
138
138
|
end
|
139
139
|
|
140
140
|
def commitResourcesUsedToProcessMsg( msgName )
|
141
|
-
|
141
|
+
RServiceBus.rlog "HandlerManager.commitResourcesUsedToProcessMsg, #{msgName}"
|
142
142
|
list = self.getListOfResourcesNeededToProcessMsg( msgName )
|
143
143
|
list.each do |resourceName|
|
144
144
|
r = @appResources[resourceName]
|
145
|
-
|
145
|
+
RServiceBus.rlog "Commit resource, #{r.class.name}"
|
146
146
|
r.Commit
|
147
147
|
r.finished
|
148
148
|
end
|
@@ -150,12 +150,12 @@ module RServiceBus
|
|
150
150
|
end
|
151
151
|
|
152
152
|
def rollbackResourcesUsedToProcessMsg( msgName )
|
153
|
-
|
153
|
+
RServiceBus.rlog "HandlerManager.rollbackResourcesUsedToProcessMsg, #{msgName}"
|
154
154
|
list = self.getListOfResourcesNeededToProcessMsg( msgName )
|
155
155
|
list.each do |resourceName|
|
156
156
|
begin
|
157
157
|
r = @appResources[resourceName]
|
158
|
-
|
158
|
+
RServiceBus.rlog "Rollback resource, #{r.class.name}"
|
159
159
|
r.Rollback
|
160
160
|
r.finished
|
161
161
|
rescue Exception => e1
|
data/lib/rservicebus/Host.rb
CHANGED
@@ -115,7 +115,7 @@ module RServiceBus
|
|
115
115
|
|
116
116
|
@config.contractList.each do |path|
|
117
117
|
require path
|
118
|
-
|
118
|
+
RServiceBus.rlog "Loaded Contract: #{path}"
|
119
119
|
end
|
120
120
|
|
121
121
|
return self
|
@@ -343,7 +343,7 @@ module RServiceBus
|
|
343
343
|
msgName = @msg.msg.class.name
|
344
344
|
handlerList = @handlerManager.getHandlerListForMsg(msgName)
|
345
345
|
|
346
|
-
|
346
|
+
RServiceBus.rlog "Handler found for: " + msgName
|
347
347
|
begin
|
348
348
|
@queueForMsgsToBeSentOnComplete = Array.new
|
349
349
|
|
@@ -381,7 +381,7 @@ module RServiceBus
|
|
381
381
|
# @param [String] serialized_object serialized RServiceBus::Message
|
382
382
|
# @param [String] queueName endpoint to which the msg will be sent
|
383
383
|
def _SendAlreadyWrappedAndSerialised( serialized_object, queueName )
|
384
|
-
|
384
|
+
RServiceBus.rlog "Bus._SendAlreadyWrappedAndSerialised"
|
385
385
|
|
386
386
|
if !@config.forwardSentMessagesTo.nil? then
|
387
387
|
@mq.send( @config.forwardSentMessagesTo, serialized_object )
|
@@ -395,18 +395,18 @@ module RServiceBus
|
|
395
395
|
# @param [RServiceBus::Message] msg msg to be sent
|
396
396
|
# @param [String] queueName endpoint to which the msg will be sent
|
397
397
|
def _SendNeedsWrapping( msg, queueName )
|
398
|
-
|
398
|
+
RServiceBus.rlog "Bus._SendNeedsWrapping"
|
399
399
|
|
400
400
|
rMsg = RServiceBus::Message.new( msg, @mq.localQueueName )
|
401
401
|
if queueName.index( "@" ).nil? then
|
402
402
|
q = queueName
|
403
|
-
|
403
|
+
RServiceBus.rlog "Sending, #{msg.class.name} to, queueName"
|
404
404
|
else
|
405
405
|
parts = queueName.split( "@" )
|
406
406
|
rMsg.setRemoteQueueName( parts[0] )
|
407
407
|
rMsg.setRemoteHostName( parts[1] )
|
408
408
|
q = 'transport-out'
|
409
|
-
|
409
|
+
RServiceBus.rlog "Sending, #{msg.class.name} to, #{queueName}, via #{q}"
|
410
410
|
end
|
411
411
|
|
412
412
|
serialized_object = YAML::dump(rMsg)
|
@@ -429,7 +429,7 @@ module RServiceBus
|
|
429
429
|
#
|
430
430
|
# @param [RServiceBus::Message] msg msg to be sent
|
431
431
|
def Reply( msg )
|
432
|
-
|
432
|
+
RServiceBus.rlog "Reply with: " + msg.class.name + " To: " + @msg.returnAddress
|
433
433
|
@stats.incTotalReply
|
434
434
|
|
435
435
|
self.queueMsgForSendOnComplete( msg, @msg.returnAddress )
|
@@ -452,7 +452,7 @@ module RServiceBus
|
|
452
452
|
#
|
453
453
|
# @param [RServiceBus::Message] msg msg to be sent
|
454
454
|
def Send( msg )
|
455
|
-
|
455
|
+
RServiceBus.rlog "Bus.Send"
|
456
456
|
@stats.incTotalSent
|
457
457
|
|
458
458
|
msgName = msg.class.name
|
@@ -465,7 +465,7 @@ module RServiceBus
|
|
465
465
|
#
|
466
466
|
# @param [RServiceBus::Message] msg msg to be sent
|
467
467
|
def Publish( msg )
|
468
|
-
|
468
|
+
RServiceBus.rlog "Bus.Publish"
|
469
469
|
@stats.incTotalPublished
|
470
470
|
|
471
471
|
subscriptions = @subscriptionManager.get(msg.class.name)
|
@@ -479,7 +479,7 @@ module RServiceBus
|
|
479
479
|
#
|
480
480
|
# @param [String] eventName event to be subscribes to
|
481
481
|
def Subscribe( eventName )
|
482
|
-
|
482
|
+
RServiceBus.rlog "Bus.Subscribe: " + eventName
|
483
483
|
|
484
484
|
queueName = self.getEndpointForMsg( eventName )
|
485
485
|
subscription = Message_Subscription.new( eventName )
|
@@ -127,13 +127,13 @@ module RServiceBus
|
|
127
127
|
|
128
128
|
fileList = Dir.glob( "#{@Path}/*" )
|
129
129
|
fileList.each do |filePath|
|
130
|
-
|
130
|
+
RServiceBus.log "Ready to process, #{filePath}"
|
131
131
|
content = self.ProcessPath( filePath )
|
132
132
|
|
133
133
|
if !@ArchiveDir.nil? then
|
134
134
|
basename = File.basename( filePath )
|
135
135
|
newFilePath = @ArchiveDir + "/" + basename + "." + DateTime.now.strftime( "%Y%m%d%H%M%S%L") + ".zip"
|
136
|
-
|
136
|
+
RServiceBus.log "Writing to archive, #{newFilePath}"
|
137
137
|
|
138
138
|
Zip::ZipOutputStream.open(newFilePath) {
|
139
139
|
|zos|
|
@@ -144,8 +144,8 @@ module RServiceBus
|
|
144
144
|
File.unlink( filePath )
|
145
145
|
|
146
146
|
fileProcessed = fileProcessed + 1
|
147
|
-
|
148
|
-
|
147
|
+
RServiceBus.log "Processed #{fileProcessed} of #{fileList.length}."
|
148
|
+
RServiceBus.log "Allow system tick #{self.class.name}"
|
149
149
|
return if fileProcessed >= maxFilesProcessed
|
150
150
|
end
|
151
151
|
|
@@ -14,16 +14,9 @@ module RServiceBus
|
|
14
14
|
|
15
15
|
class Transporter
|
16
16
|
|
17
|
-
def log( string, verbose=false )
|
18
|
-
if verbose == false ||
|
19
|
-
( !ENV["VERBOSE"].nil? && ENV["VERBOSE"].upcase == "TRUE") then
|
20
|
-
puts string
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
17
|
def getValue( name, default=nil )
|
25
18
|
value = ( ENV[name].nil? || ENV[name] == "" ) ? default : ENV[name];
|
26
|
-
log "Env value: #{name}: #{value}"
|
19
|
+
RServiceBus.log "Env value: #{name}: #{value}"
|
27
20
|
return value
|
28
21
|
end
|
29
22
|
|
@@ -33,7 +26,7 @@ module RServiceBus
|
|
33
26
|
@source = Beanstalk::Pool.new([sourceUrl])
|
34
27
|
@source.watch sourceQueueName
|
35
28
|
|
36
|
-
log "Connected to, #{sourceQueueName}@#{sourceUrl}"
|
29
|
+
RServiceBus.log "Connected to, #{sourceQueueName}@#{sourceUrl}"
|
37
30
|
|
38
31
|
rescue Exception => e
|
39
32
|
puts "Error connecting to Beanstalk"
|
@@ -50,7 +43,7 @@ module RServiceBus
|
|
50
43
|
|
51
44
|
|
52
45
|
def disconnect
|
53
|
-
log "Disconnect from, #{@remoteUserName}@#{@remoteHostName}/#{@remoteQueueName}"
|
46
|
+
RServiceBus.log "Disconnect from, #{@remoteUserName}@#{@remoteHostName}/#{@remoteQueueName}"
|
54
47
|
@gateway.shutdown! unless @gateway.nil?
|
55
48
|
@gateway = nil
|
56
49
|
@remoteHostName = nil
|
@@ -64,7 +57,7 @@ module RServiceBus
|
|
64
57
|
|
65
58
|
|
66
59
|
def connect( remoteHostName )
|
67
|
-
|
60
|
+
RServiceBus.rlog "connect called, #{remoteHostName}"
|
68
61
|
if @gateway.nil? || remoteHostName != @remoteHostName || @destination.nil? then
|
69
62
|
self.disconnect
|
70
63
|
end
|
@@ -74,20 +67,20 @@ module RServiceBus
|
|
74
67
|
@remoteHostName = remoteHostName
|
75
68
|
@remoteUserName = getValue( "REMOTE_USER_#{remoteHostName.upcase}" )
|
76
69
|
if @remoteUserName.nil? then
|
77
|
-
log "**** Username not specified for Host, #{remoteHostName}"
|
78
|
-
log "**** Add an environment variable of the form, REMOTE_USER_#{remoteHostName.upcase}=[USERNAME]"
|
70
|
+
RServiceBus.log "**** Username not specified for Host, #{remoteHostName}"
|
71
|
+
RServiceBus.log "**** Add an environment variable of the form, REMOTE_USER_#{remoteHostName.upcase}=[USERNAME]"
|
79
72
|
abort()
|
80
73
|
end
|
81
74
|
|
82
75
|
@localPort = getValue( "LOCAL_PORT", 27018 ).to_i
|
83
|
-
|
76
|
+
RServiceBus.rlog "Local Port: #{@localPort}"
|
84
77
|
|
85
78
|
begin
|
86
|
-
log "Connect SSH, #{@remoteUserName}@#{@remoteHostName}"
|
79
|
+
RServiceBus.log "Connect SSH, #{@remoteUserName}@#{@remoteHostName}"
|
87
80
|
# Open port 27018 to forward to 127.0.0.11300 on the remote host
|
88
81
|
@gateway = Net::SSH::Gateway.new(@remoteHostName, @remoteUserName)
|
89
82
|
@gateway.open('127.0.0.1', 11300, @localPort)
|
90
|
-
log "Connected to SSH, #{@remoteUserName}@#{@remoteHostName}"
|
83
|
+
RServiceBus.log "Connected to SSH, #{@remoteUserName}@#{@remoteHostName}"
|
91
84
|
|
92
85
|
rescue Errno::EADDRINUSE => e
|
93
86
|
puts "*** Local transport port in use, #{@localPort}"
|
@@ -102,9 +95,9 @@ module RServiceBus
|
|
102
95
|
|
103
96
|
begin
|
104
97
|
destinationUrl = "127.0.0.1:#{@localPort}"
|
105
|
-
|
98
|
+
RServiceBus.rlog "Connect to Remote Beanstalk, #{destinationUrl}"
|
106
99
|
@destination = Beanstalk::Pool.new([destinationUrl])
|
107
|
-
|
100
|
+
RServiceBus.rlog "Connected to Remote Beanstalk, #{destinationUrl}"
|
108
101
|
rescue Exception => e
|
109
102
|
if e.message == "Beanstalk::NotConnected" then
|
110
103
|
puts "***Could not connect to destination, check beanstalk is running at, #{destinationUrl}"
|
@@ -123,10 +116,10 @@ module RServiceBus
|
|
123
116
|
self.connect( msg.remoteHostName )
|
124
117
|
|
125
118
|
@remoteQueueName = msg.remoteQueueName
|
126
|
-
|
119
|
+
RServiceBus.rlog "Put msg, #{msg.remoteQueueName}"
|
127
120
|
@destination.use( msg.remoteQueueName )
|
128
121
|
@destination.put( job.body )
|
129
|
-
log "Msg put, #{msg.remoteQueueName}"
|
122
|
+
RServiceBus.log "Msg put, #{msg.remoteQueueName}"
|
130
123
|
|
131
124
|
if !ENV['AUDIT_QUEUE_NAME'].nil? then
|
132
125
|
@source.use ENV['AUDIT_QUEUE_NAME']
|
@@ -135,13 +128,13 @@ module RServiceBus
|
|
135
128
|
#removeJob
|
136
129
|
job.delete
|
137
130
|
|
138
|
-
log "Job sent to, #{@remoteUserName}@#{@remoteHostName}/#{@remoteQueueName}"
|
131
|
+
RServiceBus.log "Job sent to, #{@remoteUserName}@#{@remoteHostName}/#{@remoteQueueName}"
|
139
132
|
|
140
133
|
|
141
134
|
rescue Exception => e
|
142
135
|
self.disconnect
|
143
136
|
if e.message == "TIMED_OUT" then
|
144
|
-
|
137
|
+
RServiceBus.rlog "No Msg"
|
145
138
|
return
|
146
139
|
end
|
147
140
|
raise e
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module RServiceBus
|
2
|
-
|
2
|
+
|
3
3
|
|
4
4
|
def RServiceBus.convertDTOToHash( obj )
|
5
5
|
hash = {};
|
@@ -13,17 +13,24 @@ module RServiceBus
|
|
13
13
|
|
14
14
|
return hash.to_json
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
def RServiceBus.log(string, ver=false)
|
18
18
|
return unless ENV['TESTING'].nil?
|
19
|
-
|
19
|
+
|
20
20
|
type = ver ? "VERB" : "INFO"
|
21
21
|
if !ENV["VERBOSE"].nil? || !ver then
|
22
22
|
timestamp = Time.new.strftime( "%Y-%m-%d %H:%M:%S" )
|
23
23
|
puts "[#{type}] #{timestamp} :: #{string}"
|
24
24
|
end
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
|
+
def RServiceBus.rlog(string)
|
28
|
+
if !ENV["RSBVERBOSE"].nil? then
|
29
|
+
timestamp = Time.new.strftime( "%Y-%m-%d %H:%M:%S" )
|
30
|
+
puts "[RSB] #{timestamp} :: #{string}"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
27
34
|
def RServiceBus.createAnonymousClass( name_for_class )
|
28
35
|
newAnonymousClass = Class.new(Object)
|
29
36
|
Object.const_set( name_for_class, newAnonymousClass )
|
@@ -35,19 +42,19 @@ module RServiceBus
|
|
35
42
|
log "Env value: #{name}: #{value}"
|
36
43
|
return value
|
37
44
|
end
|
38
|
-
|
45
|
+
|
39
46
|
def RServiceBus.sendMsg( msg, responseQueue="agent" )
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
47
|
+
require "rservicebus/EndpointMapping"
|
48
|
+
endpointMapping = EndpointMapping.new
|
49
|
+
endpointMapping.Configure
|
50
|
+
queueName = endpointMapping.get( msg.class.name )
|
51
|
+
|
52
|
+
ENV["RSBMQ"] = "beanstalk://localhost" if ENV["RSBMQ"].nil?
|
53
|
+
agent = RServiceBus::Agent.new
|
54
|
+
Audit.new( agent ).audit( msg )
|
55
|
+
agent.sendMsg(msg, queueName, responseQueue)
|
56
|
+
|
57
|
+
rescue QueueNotFoundForMsg=>e
|
51
58
|
msg = "\n"
|
52
59
|
msg = "#{msg}*** Queue not found for, #{e.message}\n"
|
53
60
|
msg = "#{msg}*** Ensure you have an environment variable set for this Message Type, eg, \n"
|
@@ -79,8 +86,13 @@ module RServiceBus
|
|
79
86
|
agent = RServiceBus::Agent.new
|
80
87
|
msg = agent.checkForReply( queueName )
|
81
88
|
Audit.new( agent ).auditIncoming( msg )
|
82
|
-
|
89
|
+
|
83
90
|
return msg
|
84
91
|
end
|
85
92
|
|
93
|
+
def RServiceBus.tick( string )
|
94
|
+
puts "[TICK] #{Time.new.strftime( '%Y-%m-%d %H:%M:%S.%6N' )} :: #{caller[0]}. #{string}"
|
95
|
+
end
|
96
|
+
|
97
|
+
|
86
98
|
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.52
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: uuidtools
|
16
|
-
requirement: &
|
16
|
+
requirement: &70143409829480 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70143409829480
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: json
|
27
|
-
requirement: &
|
27
|
+
requirement: &70143409820780 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70143409820780
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: beanstalk-client
|
38
|
-
requirement: &
|
38
|
+
requirement: &70143409819540 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70143409819540
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: fluiddb
|
49
|
-
requirement: &
|
49
|
+
requirement: &70143409818280 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70143409818280
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: parse-cron
|
60
|
-
requirement: &
|
60
|
+
requirement: &70143409815500 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70143409815500
|
69
69
|
description: A Ruby interpretation of NServiceBus
|
70
70
|
email: guy@guyirvine.com
|
71
71
|
executables:
|