activemessaging 0.13.0 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/.travis.yml +1 -2
- data/Appraisals +4 -2
- data/Gemfile +1 -18
- data/Rakefile +3 -27
- data/activemessaging.gemspec +24 -138
- data/gemfiles/activesupport23.gemfile +3 -5
- data/gemfiles/activesupport30.gemfile +3 -5
- data/gemfiles/activesupport31.gemfile +3 -5
- data/gemfiles/activesupport32.gemfile +3 -5
- data/lib/activemessaging/test_helper.rb +11 -74
- data/lib/activemessaging/threaded_poller.rb +16 -16
- data/lib/activemessaging/version.rb +3 -0
- metadata +59 -55
- checksums.yaml +0 -7
- data/Gemfile.lock +0 -87
- data/VERSION +0 -1
- data/gemfiles/activesupport23.gemfile.lock +0 -51
- data/gemfiles/activesupport30.gemfile.lock +0 -53
- data/gemfiles/activesupport31.gemfile.lock +0 -55
- data/gemfiles/activesupport32.gemfile.lock +0 -55
- data/init.rb +0 -1
- data/poller.rb +0 -14
- data/test/all_tests.rb +0 -10
- data/test/app/config/broker.yml +0 -4
- data/test/asqs_test.rb +0 -125
- data/test/config_test.rb +0 -42
- data/test/filter_test.rb +0 -131
- data/test/gateway_test.rb +0 -220
- data/test/jms_test.rb +0 -64
- data/test/reliable_msg_test.rb +0 -83
- data/test/stomp_test.rb +0 -168
- data/test/test_helper.rb +0 -36
- data/test/tracer_test.rb +0 -57
@@ -14,9 +14,9 @@ module ActiveMessaging
|
|
14
14
|
|
15
15
|
attr_accessor :configuration, :receiver, :connection, :workers, :busy, :running, :pause
|
16
16
|
|
17
|
-
#
|
17
|
+
#
|
18
18
|
# connection is a string, name of the connection from broker.yml to use for this threaded poller instance
|
19
|
-
#
|
19
|
+
#
|
20
20
|
# configuration is a list of hashes
|
21
21
|
# each has describes a group of worker threads
|
22
22
|
# for each group, define what priorities those workers will process
|
@@ -26,7 +26,7 @@ module ActiveMessaging
|
|
26
26
|
# :priorities => [1,2,3] # what message priorities this thread will process
|
27
27
|
# }
|
28
28
|
# ]
|
29
|
-
#
|
29
|
+
#
|
30
30
|
def initialize(connection='default', configuration={})
|
31
31
|
# default config is a pool size of 3 worker threads
|
32
32
|
self.configuration = configuration || [{:pool_size => 3}]
|
@@ -39,21 +39,21 @@ module ActiveMessaging
|
|
39
39
|
|
40
40
|
# these are workers ready to use
|
41
41
|
self.workers = []
|
42
|
-
|
42
|
+
|
43
43
|
# these are workers already working
|
44
44
|
self.busy = []
|
45
|
-
|
45
|
+
|
46
46
|
# this indicates if we are running or not, helps threads to stop gracefully
|
47
47
|
self.running = true
|
48
|
-
|
48
|
+
|
49
49
|
# subscribe will create the connections based on subscriptions in processsors
|
50
50
|
# (you can't find or use the connection until it is created by calling this)
|
51
51
|
ActiveMessaging::Gateway.subscribe
|
52
|
-
|
52
|
+
|
53
53
|
# create a message receiver actor, ony need one, using connection
|
54
54
|
receiver_connection = ActiveMessaging::Gateway.connection(connection)
|
55
55
|
self.receiver = MessageReceiver.new(current_actor, receiver_connection, pause)
|
56
|
-
|
56
|
+
|
57
57
|
# start the workers based on the config
|
58
58
|
configuration.each do |c|
|
59
59
|
(c[:pool_size] || 1).times{ self.workers << Worker.new_link(current_actor, c) }
|
@@ -69,7 +69,7 @@ module ActiveMessaging
|
|
69
69
|
def stop
|
70
70
|
logger.info "ActiveMessaging::ThreadedPoller stop"
|
71
71
|
# indicates to all busy workers not to pick up another messages, but does not interrupt
|
72
|
-
# also indicates to the message receiver to stop getting more messages
|
72
|
+
# also indicates to the message receiver to stop getting more messages
|
73
73
|
self.running = false
|
74
74
|
|
75
75
|
# tell each waiting worker to shut down. Running ones will be allowed to finish
|
@@ -83,7 +83,7 @@ module ActiveMessaging
|
|
83
83
|
after(0) { signal(:shutdown) } if stopped?
|
84
84
|
end
|
85
85
|
|
86
|
-
# recursive method, uses celluloid 'after' to keep calling
|
86
|
+
# recursive method, uses celluloid 'after' to keep calling
|
87
87
|
def log_status
|
88
88
|
return unless logger.debug?
|
89
89
|
logger.debug("ActiveMessaging::ThreadedPoller: conn:#{connection}, #{workers.count}, #{busy.count}, #{running}")
|
@@ -99,7 +99,7 @@ module ActiveMessaging
|
|
99
99
|
busy << worker
|
100
100
|
worker.execute!(message)
|
101
101
|
end
|
102
|
-
|
102
|
+
|
103
103
|
def executed(worker)
|
104
104
|
busy.delete(worker)
|
105
105
|
|
@@ -131,7 +131,7 @@ module ActiveMessaging
|
|
131
131
|
end
|
132
132
|
end
|
133
133
|
end
|
134
|
-
|
134
|
+
|
135
135
|
def stopped?
|
136
136
|
(!running && busy.empty?)
|
137
137
|
end
|
@@ -155,9 +155,9 @@ module ActiveMessaging
|
|
155
155
|
|
156
156
|
def initialize(poller, connection, pause=1)
|
157
157
|
logger.debug("MessageReceiver initialize: poller:#{poller}, connection:#{connection}, pause:#{pause}")
|
158
|
-
|
158
|
+
|
159
159
|
raise "No connection found for '#{poller.connection}'" unless connection
|
160
|
-
|
160
|
+
|
161
161
|
self.poller = poller
|
162
162
|
self.connection = connection
|
163
163
|
self.pause = pause
|
@@ -181,7 +181,7 @@ module ActiveMessaging
|
|
181
181
|
logger.debug("ActiveMessaging::MessageReceiver.receive: no message for worker #{worker.object_id}, retry in #{pause} sec")
|
182
182
|
after(pause) { receive(worker) }
|
183
183
|
end
|
184
|
-
|
184
|
+
|
185
185
|
end
|
186
186
|
|
187
187
|
def inspect
|
@@ -227,7 +227,7 @@ module ActiveMessaging
|
|
227
227
|
end
|
228
228
|
|
229
229
|
def logger; ::ActiveMessaging.logger; end
|
230
|
-
|
230
|
+
|
231
231
|
end
|
232
232
|
|
233
233
|
end
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activemessaging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.1
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Jon Tirsen
|
@@ -13,92 +14,104 @@ authors:
|
|
13
14
|
- Lance Cooper
|
14
15
|
- Matt Campbell
|
15
16
|
autorequire:
|
16
|
-
bindir:
|
17
|
+
bindir: exe
|
17
18
|
cert_chain: []
|
18
|
-
date:
|
19
|
+
date: 2016-06-06 00:00:00.000000000 Z
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
|
-
name:
|
22
|
+
name: bundler
|
22
23
|
requirement: !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
23
25
|
requirements:
|
24
|
-
- - '>='
|
26
|
+
- - ! '>='
|
25
27
|
- !ruby/object:Gem::Version
|
26
28
|
version: '0'
|
27
|
-
type: :
|
29
|
+
type: :development
|
28
30
|
prerelease: false
|
29
31
|
version_requirements: !ruby/object:Gem::Requirement
|
32
|
+
none: false
|
30
33
|
requirements:
|
31
|
-
- - '>='
|
34
|
+
- - ! '>='
|
32
35
|
- !ruby/object:Gem::Version
|
33
36
|
version: '0'
|
34
37
|
- !ruby/object:Gem::Dependency
|
35
|
-
name:
|
38
|
+
name: test-unit
|
36
39
|
requirement: !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
37
41
|
requirements:
|
38
|
-
- - '>='
|
42
|
+
- - ! '>='
|
39
43
|
- !ruby/object:Gem::Version
|
40
44
|
version: '0'
|
41
45
|
type: :development
|
42
46
|
prerelease: false
|
43
47
|
version_requirements: !ruby/object:Gem::Requirement
|
48
|
+
none: false
|
44
49
|
requirements:
|
45
|
-
- - '>='
|
50
|
+
- - ! '>='
|
46
51
|
- !ruby/object:Gem::Version
|
47
52
|
version: '0'
|
48
53
|
- !ruby/object:Gem::Dependency
|
49
|
-
name:
|
54
|
+
name: stomp
|
50
55
|
requirement: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
51
57
|
requirements:
|
52
|
-
- - '>='
|
58
|
+
- - ! '>='
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
55
|
-
type: :
|
60
|
+
version: '0'
|
61
|
+
type: :development
|
56
62
|
prerelease: false
|
57
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
58
65
|
requirements:
|
59
|
-
- - '>='
|
66
|
+
- - ! '>='
|
60
67
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
68
|
+
version: '0'
|
62
69
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
70
|
+
name: appraisal
|
64
71
|
requirement: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
65
73
|
requirements:
|
66
|
-
- - '>='
|
74
|
+
- - ! '>='
|
67
75
|
- !ruby/object:Gem::Version
|
68
76
|
version: '0'
|
69
77
|
type: :development
|
70
78
|
prerelease: false
|
71
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
72
81
|
requirements:
|
73
|
-
- - '>='
|
82
|
+
- - ! '>='
|
74
83
|
- !ruby/object:Gem::Version
|
75
84
|
version: '0'
|
76
85
|
- !ruby/object:Gem::Dependency
|
77
|
-
name:
|
86
|
+
name: activesupport
|
78
87
|
requirement: !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
79
89
|
requirements:
|
80
|
-
- - '>='
|
90
|
+
- - ! '>='
|
81
91
|
- !ruby/object:Gem::Version
|
82
92
|
version: '0'
|
83
|
-
type: :
|
93
|
+
type: :runtime
|
84
94
|
prerelease: false
|
85
95
|
version_requirements: !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
86
97
|
requirements:
|
87
|
-
- - '>='
|
98
|
+
- - ! '>='
|
88
99
|
- !ruby/object:Gem::Version
|
89
100
|
version: '0'
|
90
101
|
- !ruby/object:Gem::Dependency
|
91
|
-
name:
|
102
|
+
name: rake
|
92
103
|
requirement: !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
93
105
|
requirements:
|
94
|
-
- - '>='
|
106
|
+
- - ! '>='
|
95
107
|
- !ruby/object:Gem::Version
|
96
108
|
version: '0'
|
97
|
-
type: :
|
109
|
+
type: :runtime
|
98
110
|
prerelease: false
|
99
111
|
version_requirements: !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
100
113
|
requirements:
|
101
|
-
- - '>='
|
114
|
+
- - ! '>='
|
102
115
|
- !ruby/object:Gem::Version
|
103
116
|
version: '0'
|
104
117
|
description: ActiveMessaging is an attempt to bring the simplicity and elegance of
|
@@ -106,28 +119,23 @@ description: ActiveMessaging is an attempt to bring the simplicity and elegance
|
|
106
119
|
is widely used for enterprise integration, with frameworks such as Java's JMS, and
|
107
120
|
products such as ActiveMQ, Tibco, IBM MQSeries, etc. Now supporting Rails 3 as of
|
108
121
|
version 0.8.0.
|
109
|
-
email:
|
122
|
+
email:
|
123
|
+
- activemessaging-discuss@googlegroups.com
|
110
124
|
executables: []
|
111
125
|
extensions: []
|
112
|
-
extra_rdoc_files:
|
113
|
-
- README.md
|
126
|
+
extra_rdoc_files: []
|
114
127
|
files:
|
128
|
+
- .gitignore
|
115
129
|
- .travis.yml
|
116
130
|
- Appraisals
|
117
131
|
- Gemfile
|
118
|
-
- Gemfile.lock
|
119
132
|
- README.md
|
120
133
|
- Rakefile
|
121
|
-
- VERSION
|
122
134
|
- activemessaging.gemspec
|
123
135
|
- gemfiles/activesupport23.gemfile
|
124
|
-
- gemfiles/activesupport23.gemfile.lock
|
125
136
|
- gemfiles/activesupport30.gemfile
|
126
|
-
- gemfiles/activesupport30.gemfile.lock
|
127
137
|
- gemfiles/activesupport31.gemfile
|
128
|
-
- gemfiles/activesupport31.gemfile.lock
|
129
138
|
- gemfiles/activesupport32.gemfile
|
130
|
-
- gemfiles/activesupport32.gemfile.lock
|
131
139
|
- generators/a13g_test_harness/a13g_test_harness_generator.rb
|
132
140
|
- generators/a13g_test_harness/templates/active_messaging_test.rhtml
|
133
141
|
- generators/a13g_test_harness/templates/active_messaging_test_controller.rb
|
@@ -153,7 +161,6 @@ files:
|
|
153
161
|
- generators/tracer/templates/layout.rhtml
|
154
162
|
- generators/tracer/templates/trace_processor.rb
|
155
163
|
- generators/tracer/tracer_generator.rb
|
156
|
-
- init.rb
|
157
164
|
- lib/activemessaging.rb
|
158
165
|
- lib/activemessaging/adapter.rb
|
159
166
|
- lib/activemessaging/adapters/amqp.rb
|
@@ -176,6 +183,7 @@ files:
|
|
176
183
|
- lib/activemessaging/test_helper.rb
|
177
184
|
- lib/activemessaging/threaded_poller.rb
|
178
185
|
- lib/activemessaging/trace_filter.rb
|
186
|
+
- lib/activemessaging/version.rb
|
179
187
|
- lib/generators/active_messaging/install/USAGE
|
180
188
|
- lib/generators/active_messaging/install/install_generator.rb
|
181
189
|
- lib/generators/active_messaging/install/templates/application_processor.rb
|
@@ -190,40 +198,36 @@ files:
|
|
190
198
|
- lib/generators/active_messaging/processor/templates/processor_spec.rb
|
191
199
|
- lib/generators/active_messaging/processor/templates/processor_test.rb
|
192
200
|
- lib/tasks/start_consumers.rake
|
193
|
-
- poller.rb
|
194
|
-
- test/all_tests.rb
|
195
|
-
- test/app/config/broker.yml
|
196
|
-
- test/asqs_test.rb
|
197
|
-
- test/config_test.rb
|
198
|
-
- test/filter_test.rb
|
199
|
-
- test/gateway_test.rb
|
200
|
-
- test/jms_test.rb
|
201
|
-
- test/reliable_msg_test.rb
|
202
|
-
- test/stomp_test.rb
|
203
|
-
- test/test_helper.rb
|
204
|
-
- test/tracer_test.rb
|
205
201
|
homepage: http://github.com/kookster/activemessaging
|
206
|
-
licenses:
|
207
|
-
|
202
|
+
licenses:
|
203
|
+
- MIT
|
208
204
|
post_install_message:
|
209
205
|
rdoc_options: []
|
210
206
|
require_paths:
|
211
207
|
- lib
|
212
208
|
required_ruby_version: !ruby/object:Gem::Requirement
|
209
|
+
none: false
|
213
210
|
requirements:
|
214
|
-
- - '>='
|
211
|
+
- - ! '>='
|
215
212
|
- !ruby/object:Gem::Version
|
216
213
|
version: '0'
|
214
|
+
segments:
|
215
|
+
- 0
|
216
|
+
hash: -2180912637890574200
|
217
217
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
218
|
+
none: false
|
218
219
|
requirements:
|
219
|
-
- - '>='
|
220
|
+
- - ! '>='
|
220
221
|
- !ruby/object:Gem::Version
|
221
222
|
version: '0'
|
223
|
+
segments:
|
224
|
+
- 0
|
225
|
+
hash: -2180912637890574200
|
222
226
|
requirements: []
|
223
227
|
rubyforge_project:
|
224
|
-
rubygems_version:
|
228
|
+
rubygems_version: 1.8.23.2
|
225
229
|
signing_key:
|
226
|
-
specification_version:
|
230
|
+
specification_version: 3
|
227
231
|
summary: Official activemessaging gem, now hosted on github.com/kookster. (kookster
|
228
232
|
prefix temporary)
|
229
233
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 745cf4dcd83298a2a575472d2da129aa1bd2ccd7
|
4
|
-
data.tar.gz: 3ab07801e599c5baa31d19865ed0aabcd92f23dd
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 6393cae915d5ace65f376b441431ebbf8f7c3bec550b8718c159bbffb7e5d14552128eaf064e7fc3b47213d18e54783e6f3b698a10ab46845ae1f68c5dcf8710
|
7
|
-
data.tar.gz: 921d021a74156e8584f59af770a42cff70a2058e604f6e373c48f7b96f0d02b37d63fbcfc90873dddfd3dafe97d28ae7ae9de107754f993c2c5f9cfb8c3b5cd4
|
data/Gemfile.lock
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
activemessaging (0.13.0)
|
5
|
-
activemessaging
|
6
|
-
activesupport (>= 2.3.11)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: http://rubygems.org/
|
10
|
-
specs:
|
11
|
-
activesupport (4.0.5)
|
12
|
-
i18n (~> 0.6, >= 0.6.9)
|
13
|
-
minitest (~> 4.2)
|
14
|
-
multi_json (~> 1.3)
|
15
|
-
thread_safe (~> 0.1)
|
16
|
-
tzinfo (~> 0.3.37)
|
17
|
-
addressable (2.3.6)
|
18
|
-
appraisal (0.4.1)
|
19
|
-
bundler
|
20
|
-
rake
|
21
|
-
builder (3.2.2)
|
22
|
-
celluloid (0.12.0)
|
23
|
-
timers (>= 1.0.0)
|
24
|
-
descendants_tracker (0.0.4)
|
25
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
26
|
-
faraday (0.9.0)
|
27
|
-
multipart-post (>= 1.2, < 3)
|
28
|
-
git (1.2.6)
|
29
|
-
github_api (0.11.3)
|
30
|
-
addressable (~> 2.3)
|
31
|
-
descendants_tracker (~> 0.0.1)
|
32
|
-
faraday (~> 0.8, < 0.10)
|
33
|
-
hashie (>= 1.2)
|
34
|
-
multi_json (>= 1.7.5, < 2.0)
|
35
|
-
nokogiri (~> 1.6.0)
|
36
|
-
oauth2
|
37
|
-
hashie (3.0.0)
|
38
|
-
highline (1.6.21)
|
39
|
-
i18n (0.6.9)
|
40
|
-
jeweler (2.0.1)
|
41
|
-
builder
|
42
|
-
bundler (>= 1.0)
|
43
|
-
git (>= 1.2.5)
|
44
|
-
github_api
|
45
|
-
highline (>= 1.6.15)
|
46
|
-
nokogiri (>= 1.5.10)
|
47
|
-
rake
|
48
|
-
rdoc
|
49
|
-
jruby-activemq (5.5.1-java)
|
50
|
-
json (1.8.1)
|
51
|
-
json (1.8.1-java)
|
52
|
-
jwt (1.0.0)
|
53
|
-
mini_portile (0.6.0)
|
54
|
-
minitest (4.7.5)
|
55
|
-
multi_json (1.10.1)
|
56
|
-
multi_xml (0.5.5)
|
57
|
-
multipart-post (2.0.0)
|
58
|
-
nokogiri (1.6.2.1)
|
59
|
-
mini_portile (= 0.6.0)
|
60
|
-
nokogiri (1.6.2.1-java)
|
61
|
-
oauth2 (0.9.4)
|
62
|
-
faraday (>= 0.8, < 0.10)
|
63
|
-
jwt (~> 1.0)
|
64
|
-
multi_json (~> 1.3)
|
65
|
-
multi_xml (~> 0.5)
|
66
|
-
rack (~> 1.2)
|
67
|
-
rack (1.5.2)
|
68
|
-
rake (10.3.2)
|
69
|
-
rdoc (4.1.1)
|
70
|
-
json (~> 1.4)
|
71
|
-
stomp (1.2.4)
|
72
|
-
thread_safe (0.3.4)
|
73
|
-
thread_safe (0.3.4-java)
|
74
|
-
timers (1.0.1)
|
75
|
-
tzinfo (0.3.39)
|
76
|
-
|
77
|
-
PLATFORMS
|
78
|
-
java
|
79
|
-
ruby
|
80
|
-
|
81
|
-
DEPENDENCIES
|
82
|
-
activemessaging!
|
83
|
-
appraisal
|
84
|
-
celluloid (~> 0.12)
|
85
|
-
jeweler
|
86
|
-
jruby-activemq
|
87
|
-
stomp
|