rservicebus 0.1.53 → 0.1.54
Sign up to get free protection for your applications and to get access to all the features.
- metadata +13 -14
- data/bin/ReturnErroredMessagesToSourceQueue +0 -55
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.54
|
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-
|
12
|
+
date: 2013-11-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: uuidtools
|
16
|
-
requirement: &
|
16
|
+
requirement: &70255951437400 !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: *70255951437400
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: json
|
27
|
-
requirement: &
|
27
|
+
requirement: &70255951436560 !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: *70255951436560
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: beanstalk-client
|
38
|
-
requirement: &
|
38
|
+
requirement: &70255951435660 !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: *70255951435660
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: fluiddb
|
49
|
-
requirement: &
|
49
|
+
requirement: &70255951434720 !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: *70255951434720
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: parse-cron
|
60
|
-
requirement: &
|
60
|
+
requirement: &70255951434020 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,13 +65,13 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70255951434020
|
69
69
|
description: A Ruby interpretation of NServiceBus
|
70
70
|
email: guy@guyirvine.com
|
71
71
|
executables:
|
72
72
|
- rservicebus
|
73
73
|
- rservicebus-init
|
74
|
-
-
|
74
|
+
- ReturnMessagesToSourceQueue
|
75
75
|
- SendEmptyMessage
|
76
76
|
- rservicebus-transport
|
77
77
|
extensions: []
|
@@ -136,7 +136,6 @@ files:
|
|
136
136
|
- lib/rservicebus/Transporter.rb
|
137
137
|
- lib/rservicebus/UserMessage/WithPayload.rb
|
138
138
|
- lib/rservicebus.rb
|
139
|
-
- bin/ReturnErroredMessagesToSourceQueue
|
140
139
|
- bin/ReturnMessagesToSourceQueue
|
141
140
|
- bin/rsb_ctl
|
142
141
|
- bin/rservicebus
|
@@ -1,55 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "yaml"
|
4
|
-
|
5
|
-
require "beanstalk-client"
|
6
|
-
|
7
|
-
require "rservicebus"
|
8
|
-
|
9
|
-
begin
|
10
|
-
host = 'localhost:11300'
|
11
|
-
errorQueueName = "error"
|
12
|
-
beanstalk = Beanstalk::Pool.new([host])
|
13
|
-
|
14
|
-
tubes = beanstalk.list_tubes[host]
|
15
|
-
if !tubes.include?(errorQueueName) then
|
16
|
-
abort( "Nothing waiting on the Beanstalk error queue" )
|
17
|
-
end
|
18
|
-
|
19
|
-
tubeStats = beanstalk.stats_tube(errorQueueName)
|
20
|
-
number_of_messages = tubeStats["current-jobs-ready"]
|
21
|
-
puts
|
22
|
-
puts "Attempting to return #{number_of_messages} to their source queue"
|
23
|
-
puts
|
24
|
-
|
25
|
-
firstMatch = "ruby/object:"
|
26
|
-
begin
|
27
|
-
beanstalk.watch(errorQueueName)
|
28
|
-
1.upto(number_of_messages) do |request_nbr|
|
29
|
-
job = beanstalk.reserve 1
|
30
|
-
payload = job.body
|
31
|
-
|
32
|
-
firstIndex = payload.index( firstMatch )
|
33
|
-
startIndex = payload.index( firstMatch, firstIndex + 1 ) + firstMatch.length
|
34
|
-
|
35
|
-
msgName = payload.match( '(\w*)', startIndex )[1]
|
36
|
-
|
37
|
-
msg = YAML::load(payload)
|
38
|
-
queueName = msg.getLastErrorMsg.sourceQueue
|
39
|
-
puts "#" + "#{request_nbr.to_s}: #{msgName} to #{queueName}"
|
40
|
-
|
41
|
-
beanstalk.use( queueName )
|
42
|
-
beanstalk.put( payload )
|
43
|
-
|
44
|
-
job.delete
|
45
|
-
end
|
46
|
-
rescue Exception => e
|
47
|
-
if e.message == "TIMED_OUT" then
|
48
|
-
else
|
49
|
-
raise
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
rescue Beanstalk::NotConnected=>e
|
54
|
-
puts "Beanstalk not running"
|
55
|
-
end
|