rservicebus 0.0.72 → 0.0.73
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.
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'net/scp'
|
2
|
+
|
3
|
+
module RServiceBus
|
4
|
+
|
5
|
+
class ScpUploadHelper
|
6
|
+
def initialize( uri )
|
7
|
+
@uri = uri
|
8
|
+
end
|
9
|
+
|
10
|
+
def upload( source )
|
11
|
+
#opportunity for smarts here. Could tar zip if it was a directory of files
|
12
|
+
|
13
|
+
Net::SCP.upload!(@uri.host, @uri.user, source, @uri.path )
|
14
|
+
end
|
15
|
+
|
16
|
+
def close
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
class AppResource_ScpUpload<AppResource
|
22
|
+
|
23
|
+
def connect(uri)
|
24
|
+
return ScpUploadHelper.new( uri )
|
25
|
+
|
26
|
+
return inputDir;
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -38,6 +38,9 @@ module RServiceBus
|
|
38
38
|
when "file"
|
39
39
|
require "rservicebus/AppResource/File"
|
40
40
|
resources[k.sub( "RSB_", "" )] = AppResource_File.new( host, uri )
|
41
|
+
when "scpupload"
|
42
|
+
require "rservicebus/AppResource/ScpUpload"
|
43
|
+
resources[k.sub( "RSB_", "" )] = AppResource_ScpUpload.new( host, uri )
|
41
44
|
else
|
42
45
|
abort("Scheme, #{uri.scheme}, not recognised when configuring app resource, #{k}=#{v}");
|
43
46
|
end
|
@@ -5,7 +5,7 @@ module RServiceBus
|
|
5
5
|
# handlernames, and
|
6
6
|
# loading handlers
|
7
7
|
class HandlerManager
|
8
|
-
|
8
|
+
|
9
9
|
# Constructor
|
10
10
|
#
|
11
11
|
# @param [RServiceBus::Host] host instance
|
@@ -17,8 +17,8 @@ module RServiceBus
|
|
17
17
|
@handlerList = Hash.new
|
18
18
|
@resourceListByHandlerName = Hash.new
|
19
19
|
end
|
20
|
-
|
21
|
-
|
20
|
+
|
21
|
+
|
22
22
|
# setBusAttributeIfRequested
|
23
23
|
#
|
24
24
|
# @param [RServiceBus::Handler] handler
|
@@ -145,5 +145,14 @@ module RServiceBus
|
|
145
145
|
def canMsgBeHandledLocally( msgName )
|
146
146
|
return @handlerList.has_key?(msgName)
|
147
147
|
end
|
148
|
+
|
149
|
+
def getStats
|
150
|
+
list = Array.new
|
151
|
+
@handlerList.each do |k,v|
|
152
|
+
list << v.inspect
|
153
|
+
end
|
154
|
+
|
155
|
+
return list
|
156
|
+
end
|
148
157
|
end
|
149
158
|
end
|
data/lib/rservicebus/Host.rb
CHANGED
@@ -90,7 +90,7 @@ module RServiceBus
|
|
90
90
|
@config.handlerPathList.each do |path|
|
91
91
|
@handlerLoader.loadHandlersFromPath(path)
|
92
92
|
end
|
93
|
-
|
93
|
+
|
94
94
|
return self
|
95
95
|
end
|
96
96
|
|
@@ -190,6 +190,7 @@ module RServiceBus
|
|
190
190
|
begin
|
191
191
|
if statOutputCountdown == 0 then
|
192
192
|
log @stats.getForReporting, true
|
193
|
+
# log @handlerManager.getStats, true
|
193
194
|
statOutputCountdown = @config.statOutputCountdown
|
194
195
|
GC.start
|
195
196
|
end
|
data/lib/rservicebus/Stats.rb
CHANGED
@@ -13,6 +13,9 @@ class Stats
|
|
13
13
|
@totalReply = 0
|
14
14
|
|
15
15
|
@totalByMessageType = Hash.new
|
16
|
+
|
17
|
+
@written = false
|
18
|
+
|
16
19
|
end
|
17
20
|
|
18
21
|
def incTotalProcessed
|
@@ -51,14 +54,26 @@ class Stats
|
|
51
54
|
|
52
55
|
end
|
53
56
|
|
57
|
+
def getForReporting2
|
58
|
+
if @written == false then
|
59
|
+
@written = true
|
60
|
+
types = Hash.new(0)
|
61
|
+
ObjectSpace.each_object do|obj|
|
62
|
+
types[obj.class]+=1
|
63
|
+
end
|
64
|
+
|
65
|
+
return types
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
54
69
|
def getForReporting
|
55
70
|
string = "T:#{@totalProcessed};E:#{@totalErrored};S:#{@totalSent};P:#{@totalPublished};R:#{@totalReply}"
|
56
71
|
|
57
|
-
if @hash.length > 0 then
|
58
|
-
@hash.each do |k,v|
|
59
|
-
string = "#{string};#{k}:#{v}"
|
60
|
-
end
|
61
|
-
end
|
72
|
+
# if @hash.length > 0 then
|
73
|
+
# @hash.each do |k,v|
|
74
|
+
# string = "#{string};#{k}:#{v}"
|
75
|
+
# end
|
76
|
+
# end
|
62
77
|
|
63
78
|
return string
|
64
79
|
end
|
@@ -14,7 +14,9 @@ class SubscriptionManager
|
|
14
14
|
def get( eventName )
|
15
15
|
subscriptions = @subscriptions[eventName]
|
16
16
|
if subscriptions.nil? then
|
17
|
-
RServiceBus.log "No subscribers for event, "
|
17
|
+
RServiceBus.log "No subscribers for event, #{eventName}"
|
18
|
+
RServiceBus.log "If there should be, ensure you have the appropriate evironment variable set, eg MESSAGE_ENDPOINT_MAPPINGS=#{eventName}:<Queue Name>"
|
19
|
+
|
18
20
|
return Array.new
|
19
21
|
end
|
20
22
|
|
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.73
|
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-07-19 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A Ruby interpretation of NServiceBus
|
15
15
|
email: guy@guyirvine.com
|
@@ -34,6 +34,7 @@ files:
|
|
34
34
|
- lib/rservicebus/AppResource/FluidDbTinyTds.rb
|
35
35
|
- lib/rservicebus/AppResource/Mysql.rb
|
36
36
|
- lib/rservicebus/AppResource/Redis.rb
|
37
|
+
- lib/rservicebus/AppResource/ScpUpload.rb
|
37
38
|
- lib/rservicebus/AppResource.rb
|
38
39
|
- lib/rservicebus/Config.rb
|
39
40
|
- lib/rservicebus/ConfigureAppResource.rb
|