gz_activemessaging 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.travis.yml +40 -0
- data/Appraisals +19 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +87 -0
- data/README.md +27 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/activemessaging.gemspec +137 -0
- data/gemfiles/activesupport23.gemfile +10 -0
- data/gemfiles/activesupport23.gemfile.lock +51 -0
- data/gemfiles/activesupport30.gemfile +11 -0
- data/gemfiles/activesupport30.gemfile.lock +53 -0
- data/gemfiles/activesupport31.gemfile +11 -0
- data/gemfiles/activesupport31.gemfile.lock +55 -0
- data/gemfiles/activesupport32.gemfile +10 -0
- data/gemfiles/activesupport32.gemfile.lock +55 -0
- data/generators/a13g_test_harness/a13g_test_harness_generator.rb +19 -0
- data/generators/a13g_test_harness/templates/active_messaging_test.rhtml +13 -0
- data/generators/a13g_test_harness/templates/active_messaging_test_controller.rb +29 -0
- data/generators/a13g_test_harness/templates/index.rhtml +17 -0
- data/generators/filter/USAGE +0 -0
- data/generators/filter/filter_generator.rb +19 -0
- data/generators/filter/templates/filter.rb +12 -0
- data/generators/filter/templates/filter_test.rb +28 -0
- data/generators/processor/USAGE +8 -0
- data/generators/processor/processor_generator.rb +31 -0
- data/generators/processor/templates/application_processor.rb +18 -0
- data/generators/processor/templates/broker.yml +140 -0
- data/generators/processor/templates/jruby_poller +117 -0
- data/generators/processor/templates/messaging.rb +12 -0
- data/generators/processor/templates/poller +25 -0
- data/generators/processor/templates/poller.rb +26 -0
- data/generators/processor/templates/processor.rb +8 -0
- data/generators/processor/templates/processor_test.rb +20 -0
- data/generators/tracer/USAGE +8 -0
- data/generators/tracer/templates/controller.rb +14 -0
- data/generators/tracer/templates/helper.rb +2 -0
- data/generators/tracer/templates/index.rhtml +4 -0
- data/generators/tracer/templates/layout.rhtml +16 -0
- data/generators/tracer/templates/trace_processor.rb +100 -0
- data/generators/tracer/tracer_generator.rb +25 -0
- data/init.rb +1 -0
- data/lib/activemessaging.rb +133 -0
- data/lib/activemessaging/adapter.rb +20 -0
- data/lib/activemessaging/adapters/amqp.rb +215 -0
- data/lib/activemessaging/adapters/asqs.rb +487 -0
- data/lib/activemessaging/adapters/base.rb +71 -0
- data/lib/activemessaging/adapters/beanstalk.rb +88 -0
- data/lib/activemessaging/adapters/jms.rb +243 -0
- data/lib/activemessaging/adapters/reliable_msg.rb +186 -0
- data/lib/activemessaging/adapters/stomp.rb +212 -0
- data/lib/activemessaging/adapters/synch.rb +95 -0
- data/lib/activemessaging/adapters/test.rb +137 -0
- data/lib/activemessaging/adapters/wmq.rb +193 -0
- data/lib/activemessaging/base_message.rb +28 -0
- data/lib/activemessaging/filter.rb +29 -0
- data/lib/activemessaging/gateway.rb +429 -0
- data/lib/activemessaging/message_sender.rb +30 -0
- data/lib/activemessaging/named_base.rb +54 -0
- data/lib/activemessaging/processor.rb +44 -0
- data/lib/activemessaging/railtie.rb +26 -0
- data/lib/activemessaging/test_helper.rb +189 -0
- data/lib/activemessaging/threaded_poller.rb +234 -0
- data/lib/activemessaging/trace_filter.rb +34 -0
- data/lib/generators/active_messaging/install/USAGE +21 -0
- data/lib/generators/active_messaging/install/install_generator.rb +39 -0
- data/lib/generators/active_messaging/install/templates/application_processor.rb +18 -0
- data/lib/generators/active_messaging/install/templates/broker.yml +139 -0
- data/lib/generators/active_messaging/install/templates/poller +24 -0
- data/lib/generators/active_messaging/install/templates/poller.rb +22 -0
- data/lib/generators/active_messaging/install/templates/threaded_poller +46 -0
- data/lib/generators/active_messaging/processor/USAGE +2 -0
- data/lib/generators/active_messaging/processor/processor_generator.rb +39 -0
- data/lib/generators/active_messaging/processor/templates/messaging.rb +12 -0
- data/lib/generators/active_messaging/processor/templates/processor.rb +8 -0
- data/lib/generators/active_messaging/processor/templates/processor_spec.rb +24 -0
- data/lib/generators/active_messaging/processor/templates/processor_test.rb +20 -0
- data/lib/tasks/start_consumers.rake +8 -0
- data/poller.rb +14 -0
- data/test/all_tests.rb +10 -0
- data/test/app/config/broker.yml +4 -0
- data/test/asqs_test.rb +125 -0
- data/test/config_test.rb +42 -0
- data/test/filter_test.rb +131 -0
- data/test/gateway_test.rb +220 -0
- data/test/jms_test.rb +64 -0
- data/test/reliable_msg_test.rb +83 -0
- data/test/stomp_test.rb +168 -0
- data/test/test_helper.rb +36 -0
- data/test/tracer_test.rb +57 -0
- metadata +202 -0
data/test/jms_test.rb
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper'
|
2
|
+
|
3
|
+
if defined?(JRUBY_VERSION)
|
4
|
+
|
5
|
+
require 'activemessaging/adapters/jms'
|
6
|
+
|
7
|
+
class JmsTest < Test::Unit::TestCase
|
8
|
+
|
9
|
+
def setup
|
10
|
+
@test_txt = 'Yo Homie!'
|
11
|
+
@isolation_const = rand(99999999)
|
12
|
+
@connection = ActiveMessaging::Adapters::Jms::Connection.new(:url => 'vm://jms_test',
|
13
|
+
:login => '',
|
14
|
+
:passcode => '',
|
15
|
+
:connection_factory => 'org.apache.activemq.ActiveMQConnectionFactory')
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_send
|
19
|
+
@connection.send "/queue/TestQueue#{@isolation_const}", @test_txt, {}
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_receive_with_one
|
23
|
+
@connection.send "/queue/TestQueue#{@isolation_const}", @test_txt
|
24
|
+
@connection.subscribe "/queue/TestQueue#{@isolation_const}"
|
25
|
+
message = @connection.receive
|
26
|
+
assert_equal @test_txt, message.body
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_receive_multi
|
30
|
+
10.times do |i|
|
31
|
+
@connection.send "/queue/MultiQueue#{@isolation_const}", @test_txt
|
32
|
+
end
|
33
|
+
|
34
|
+
counter=0
|
35
|
+
@connection.subscribe "/queue/MultiQueue#{@isolation_const}"
|
36
|
+
while message = @connection.receive
|
37
|
+
assert_equal @test_txt, message.body
|
38
|
+
counter += 1
|
39
|
+
end
|
40
|
+
assert_equal 10, counter
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_one_off_receive
|
44
|
+
@connection.send "/queue/OneOff#{@isolation_const}", "one off message"
|
45
|
+
sleep 2
|
46
|
+
message = @connection.receive "/queue/OneOff#{@isolation_const}"
|
47
|
+
assert_equal "one off message", message.body
|
48
|
+
assert_equal "MESSAGE", message.command
|
49
|
+
assert_equal "/queue/OneOff#{@isolation_const}", message.headers['destination']
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_unsubscribe
|
53
|
+
@connection.subscribe "/queue/TestSubQueue#{@isolation_const}"
|
54
|
+
@connection.unsubscribe "/queue/TestSubQueue#{@isolation_const}"
|
55
|
+
assert_nil @connection.consumers["TestSubQueue#{@isolation_const}"]
|
56
|
+
end
|
57
|
+
|
58
|
+
def teardown
|
59
|
+
@connection.close unless @connection.nil?
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper'
|
2
|
+
loaded = true
|
3
|
+
begin
|
4
|
+
require 'reliable-msg'
|
5
|
+
rescue Object => e
|
6
|
+
loaded = false
|
7
|
+
end
|
8
|
+
if loaded
|
9
|
+
|
10
|
+
require 'activemessaging/adapters/reliable_msg'
|
11
|
+
|
12
|
+
class ReliableMsgTest < Test::Unit::TestCase
|
13
|
+
|
14
|
+
def setup
|
15
|
+
@qm = ReliableMsg::QueueManager.new
|
16
|
+
@qm.start
|
17
|
+
@connection = ActiveMessaging::Adapters::ReliableMsgConnection.new(:reliable=>false, :poll_interval=>2)
|
18
|
+
@d = "/queue/reliable.msg.test}."
|
19
|
+
@message = "mary had a little lamb"
|
20
|
+
@message2 = "whose fleece was white as snow"
|
21
|
+
end
|
22
|
+
|
23
|
+
def teardown
|
24
|
+
@connection.disconnect unless @connection.nil?
|
25
|
+
@qm.stop unless @qm.nil?
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_subscribe_and_unsubscribe
|
29
|
+
assert_nil @connection.subscriptions["#{@d}test_subscribe"]
|
30
|
+
@connection.subscribe "#{@d}test_subscribe"
|
31
|
+
assert_equal 1, @connection.subscriptions["#{@d}test_subscribe"].count
|
32
|
+
@connection.subscribe "#{@d}test_subscribe"
|
33
|
+
assert_equal 2, @connection.subscriptions["#{@d}test_subscribe"].count
|
34
|
+
@connection.unsubscribe "#{@d}test_subscribe"
|
35
|
+
assert_equal 1, @connection.subscriptions["#{@d}test_subscribe"].count
|
36
|
+
@connection.unsubscribe "#{@d}test_subscribe"
|
37
|
+
assert_nil @connection.subscriptions["#{@d}test_subscribe"]
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_send_and_receive
|
41
|
+
@connection.subscribe "#{@d}test_send_and_receive"
|
42
|
+
@connection.send "#{@d}test_send_and_receive", @message
|
43
|
+
message = @connection.receive
|
44
|
+
@connection.received message
|
45
|
+
assert_equal @message, message.body
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
def test_send_and_receive_multiple_subscriptions
|
50
|
+
@connection.subscribe "#{@d}test_send_and_receive1"
|
51
|
+
@connection.subscribe "#{@d}test_send_and_receive2"
|
52
|
+
@connection.subscribe "#{@d}test_send_and_receive3"
|
53
|
+
|
54
|
+
@connection.send "#{@d}test_send_and_receive2", "message2"
|
55
|
+
message = @connection.receive
|
56
|
+
@connection.received message
|
57
|
+
assert_equal "message2", message.body
|
58
|
+
|
59
|
+
@connection.send "#{@d}test_send_and_receive3", "message3"
|
60
|
+
message = @connection.receive
|
61
|
+
@connection.received message
|
62
|
+
assert_equal "message3", message.body
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
def test_will_cause_sleep
|
68
|
+
|
69
|
+
begin
|
70
|
+
Timeout.timeout 10 do
|
71
|
+
@connection.subscribe "#{@d}test_will_cause_sleep"
|
72
|
+
message = @connection.receive
|
73
|
+
@connection.received message
|
74
|
+
assert false
|
75
|
+
end
|
76
|
+
rescue Timeout::Error=>toe
|
77
|
+
assert true
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
end # if loaded
|
data/test/stomp_test.rb
ADDED
@@ -0,0 +1,168 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper'
|
2
|
+
require 'activemessaging/adapters/stomp'
|
3
|
+
|
4
|
+
loaded = true
|
5
|
+
begin
|
6
|
+
require 'stomp'
|
7
|
+
rescue Object => e
|
8
|
+
loaded = false
|
9
|
+
end
|
10
|
+
if loaded #only run these test if stomp gem installed
|
11
|
+
|
12
|
+
|
13
|
+
class FakeTCPSocket
|
14
|
+
attr_accessor :sent_messages
|
15
|
+
def initialize; @sent_messages=[]; end
|
16
|
+
def puts(s=""); @sent_messages << s; end
|
17
|
+
def write(s=""); self.puts s; end
|
18
|
+
def ready?; true; end
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
module Stomp
|
23
|
+
class Connection
|
24
|
+
|
25
|
+
attr_accessor :subscriptions
|
26
|
+
|
27
|
+
def socket
|
28
|
+
@socket = FakeTCPSocket.new if @socket.nil?
|
29
|
+
@socket
|
30
|
+
end
|
31
|
+
|
32
|
+
def receive=(msg)
|
33
|
+
# stomp 1.0.5 code, now no longer works
|
34
|
+
# sm = Stomp::Message.new do |m|
|
35
|
+
# m.command = 'MESSAGE'
|
36
|
+
# m.body = msg
|
37
|
+
# m.headers = {'message-id'=>'testmessage1', 'content-length'=>msg.length, 'destination'=>'destination1'}
|
38
|
+
# end
|
39
|
+
|
40
|
+
sm = Stomp::Message.new("MESSAGE\ndestination:/queue/stomp/destination/1\nmessage-id: messageid1\ncontent-length:#{msg.length}\n\n#{msg}\0\n")
|
41
|
+
|
42
|
+
sm.command = 'MESSAGE'
|
43
|
+
sm.headers = {'message-id'=>'testmessage1', 'content-length'=>msg.length, 'destination'=>'destination1'}
|
44
|
+
|
45
|
+
@test_message = ActiveMessaging::Adapters::Stomp::Message.new(sm)
|
46
|
+
end
|
47
|
+
|
48
|
+
def receive
|
49
|
+
@test_message
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
class StompTest < Test::Unit::TestCase
|
55
|
+
|
56
|
+
def setup
|
57
|
+
@connection = ActiveMessaging::Adapters::Stomp::Connection.new({})
|
58
|
+
@d = "/queue/stomp/destination/1"
|
59
|
+
@message = "mary had a little lamb"
|
60
|
+
@connection.stomp_connection.receive = @message
|
61
|
+
end
|
62
|
+
|
63
|
+
def sent_command
|
64
|
+
@connection.stomp_connection.socket.sent_messages[0]
|
65
|
+
end
|
66
|
+
|
67
|
+
def sent_headers
|
68
|
+
@connection.stomp_connection.socket.sent_messages.drop(1).take_while { |line| !line.empty? }
|
69
|
+
end
|
70
|
+
|
71
|
+
def sent_body
|
72
|
+
(@connection.stomp_connection.socket.sent_messages.drop_while {|line| !line.empty?}).drop(1).first
|
73
|
+
end
|
74
|
+
|
75
|
+
def test_initialize
|
76
|
+
i = { :retryMax => 4,
|
77
|
+
:deadLetterQueue=>'/queue/dlq',
|
78
|
+
:login=>"",
|
79
|
+
:passcode=> "",
|
80
|
+
:host=> "localhost",
|
81
|
+
:port=> "61613",
|
82
|
+
:reliable=>FALSE,
|
83
|
+
:reconnectDelay=> 5,
|
84
|
+
:clientId=> 'cid',
|
85
|
+
:deadLetterQueuePrefix=>"DLQ."}
|
86
|
+
|
87
|
+
@connection = ActiveMessaging::Adapters::Stomp::Connection.new(i)
|
88
|
+
assert_equal 4, @connection.retryMax
|
89
|
+
assert_equal '/queue/dlq', @connection.deadLetterQueue
|
90
|
+
assert_equal "DLQ.", @connection.deadLetterQueuePrefix
|
91
|
+
assert_equal true, @connection.supports_dlq?
|
92
|
+
end
|
93
|
+
|
94
|
+
def test_disconnect
|
95
|
+
@connection.disconnect
|
96
|
+
assert_equal "DISCONNECT", sent_command
|
97
|
+
end
|
98
|
+
|
99
|
+
def test_subscribe
|
100
|
+
@connection.subscribe @d, {}
|
101
|
+
assert_equal "SUBSCRIBE", sent_command
|
102
|
+
assert sent_headers.include?("content-length:0"), "No content-length header was sent"
|
103
|
+
assert sent_headers.include?("destination:#{@d}"), "No destination header was sent"
|
104
|
+
assert_equal 1, @connection.stomp_connection.subscriptions.count
|
105
|
+
assert_equal({:'content-type'=>'text/plain; charset=UTF-8', :'content-length'=>'0', :destination=>@d}, @connection.stomp_connection.subscriptions[@d])
|
106
|
+
end
|
107
|
+
|
108
|
+
def test_unsubscribe
|
109
|
+
@connection.subscribe @d, {}
|
110
|
+
@connection.stomp_connection.socket.sent_messages = []
|
111
|
+
@connection.unsubscribe @d, {}
|
112
|
+
assert_equal "UNSUBSCRIBE", sent_command
|
113
|
+
assert sent_headers.include?("content-length:0"), "No content-length header was sent"
|
114
|
+
assert sent_headers.include?("destination:#{@d}"), "No destination header was sent"
|
115
|
+
assert_equal 0, @connection.stomp_connection.subscriptions.count
|
116
|
+
end
|
117
|
+
|
118
|
+
def test_send
|
119
|
+
@connection.send(@d, @message, {})
|
120
|
+
assert_equal 'SEND', sent_command
|
121
|
+
assert sent_headers.include?("content-length:#{@message.length}"), "No content-length header was sent"
|
122
|
+
assert sent_headers.include?("destination:#{@d}"), "No destination header was sent"
|
123
|
+
# assert_equal @message, @connection.stomp_connection.socket.sent_messages[5]
|
124
|
+
assert_equal @message, sent_body
|
125
|
+
end
|
126
|
+
|
127
|
+
def test_receive
|
128
|
+
m = @connection.receive
|
129
|
+
assert_equal @message, m.body
|
130
|
+
end
|
131
|
+
|
132
|
+
def test_received
|
133
|
+
m = @connection.receive
|
134
|
+
m.headers[:transaction] = 'test-transaction'
|
135
|
+
@connection.received m, {:ack=>'client'}
|
136
|
+
end
|
137
|
+
|
138
|
+
def test_unreceive
|
139
|
+
@connection = ActiveMessaging::Adapters::Stomp::Connection.new({:retryMax=>4, :deadLetterQueue=>'/queue/dlq'})
|
140
|
+
@connection.stomp_connection.receive = @message
|
141
|
+
m = @connection.receive
|
142
|
+
m.headers["a13g-retry-count"] = 5
|
143
|
+
@connection.unreceive m, {:ack=>'client'}
|
144
|
+
end
|
145
|
+
|
146
|
+
def test_unreceive_with_dlq_prefix
|
147
|
+
@connection = ActiveMessaging::Adapters::Stomp::Connection.new({:retryMax=>4, :deadLetterQueuePrefix=>'DLQ.'})
|
148
|
+
@connection.stomp_connection.receive = @message
|
149
|
+
m = @connection.receive
|
150
|
+
m.headers["a13g-retry-count"] = 5
|
151
|
+
@connection.unreceive m, {:ack=>'client', :destination=>"/queue/myqueue"}
|
152
|
+
end
|
153
|
+
|
154
|
+
def test_add_dlq_prefix
|
155
|
+
@connection = ActiveMessaging::Adapters::Stomp::Connection.new({:deadLetterQueuePrefix=>'DLQ.'})
|
156
|
+
dlq = @connection.add_dlq_prefix("/queue/myqueue")
|
157
|
+
assert_equal "/queue/DLQ.myqueue", dlq
|
158
|
+
dlq = @connection.add_dlq_prefix("/queue/something/myqueue")
|
159
|
+
assert_equal "/queue/something/DLQ.myqueue", dlq
|
160
|
+
dlq = @connection.add_dlq_prefix("/topic/myqueue")
|
161
|
+
assert_equal "/topic/DLQ.myqueue", dlq
|
162
|
+
dlq = @connection.add_dlq_prefix("myqueue")
|
163
|
+
assert_equal "DLQ.myqueue", dlq
|
164
|
+
end
|
165
|
+
|
166
|
+
end
|
167
|
+
|
168
|
+
end # if loaded
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
rails_environtment_file = File.expand_path(File.dirname(__FILE__) + "/../../../../config/environment")
|
2
|
+
|
3
|
+
if File.exists? rails_environtment_file
|
4
|
+
require rails_environment_file
|
5
|
+
APP_ROOT = RAILS_ROOT
|
6
|
+
APP_ENV = Rails.env
|
7
|
+
else
|
8
|
+
ENV['APP_ENV'] = 'test'
|
9
|
+
APP_ENV = 'test'
|
10
|
+
APP_ROOT = File.dirname(__FILE__) + '/app'
|
11
|
+
|
12
|
+
$: << File.expand_path(File.dirname(__FILE__) + '/../lib')
|
13
|
+
require 'rubygems'
|
14
|
+
require 'active_support/all'
|
15
|
+
|
16
|
+
module ActiveMessaging
|
17
|
+
def self.app_root
|
18
|
+
APP_ROOT
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.app_env
|
22
|
+
APP_ENV
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require 'activemessaging/message_sender'
|
27
|
+
require 'activemessaging/processor'
|
28
|
+
require 'activemessaging/gateway'
|
29
|
+
require 'activemessaging/filter'
|
30
|
+
require 'activemessaging/adapters/test'
|
31
|
+
end
|
32
|
+
|
33
|
+
# load other libraries
|
34
|
+
require 'test/unit'
|
35
|
+
|
36
|
+
require File.dirname(__FILE__) + '/../lib/activemessaging/test_helper'
|
data/test/tracer_test.rb
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper'
|
2
|
+
require 'activemessaging/trace_filter'
|
3
|
+
|
4
|
+
module ActiveMessaging #:nodoc:
|
5
|
+
def self.reload_activemessaging
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class TestProcessor < ActiveMessaging::Processor
|
10
|
+
def on_message message
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class TestSender < ActiveMessaging::Processor
|
15
|
+
end
|
16
|
+
|
17
|
+
class FakeMessage < ActiveMessaging::BaseMessage
|
18
|
+
def initialize
|
19
|
+
super("Ni hao ma?", 1, {'destination'=>'/queue/helloWorld'}, '/queue/helloWorld')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class TracerTest < Test::Unit::TestCase
|
24
|
+
include ActiveMessaging::TestHelper
|
25
|
+
|
26
|
+
def setup
|
27
|
+
ActiveMessaging::Gateway.define do |s|
|
28
|
+
s.queue :hello_world, '/queue/helloWorld'
|
29
|
+
s.queue :trace, '/queue/trace'
|
30
|
+
|
31
|
+
s.filter :trace_filter, :queue=>:trace
|
32
|
+
end
|
33
|
+
|
34
|
+
TestProcessor.subscribes_to :hello_world
|
35
|
+
TestSender.publishes_to :hello_world
|
36
|
+
end
|
37
|
+
|
38
|
+
def teardown
|
39
|
+
ActiveMessaging::Gateway.reset
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_should_trace_sent_messages
|
43
|
+
message = "Ni hao ma?"
|
44
|
+
|
45
|
+
sender = TestSender.new
|
46
|
+
sender.publish :hello_world, message
|
47
|
+
|
48
|
+
assert_message :trace, "<sent><from>TestSender</from><queue>hello_world</queue><message>#{message}</message></sent>"
|
49
|
+
assert_message :hello_world, message
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_should_trace_received_messages
|
53
|
+
ActiveMessaging::Gateway.dispatch FakeMessage.new
|
54
|
+
|
55
|
+
assert_message :trace, "<received><by>TestProcessor</by><queue>hello_world</queue><message>Ni hao ma?</message></received>"
|
56
|
+
end
|
57
|
+
end
|
metadata
ADDED
@@ -0,0 +1,202 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gz_activemessaging
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.13.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jon Tirsen
|
8
|
+
- Andrew Kuklewicz
|
9
|
+
- Olle Jonsson
|
10
|
+
- Sylvain Perez
|
11
|
+
- Cliff Moon
|
12
|
+
- Uwe Kubosch
|
13
|
+
- Lance Cooper
|
14
|
+
- Matt Campbell
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
date: 2015-04-03 00:00:00.000000000 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: activesupport
|
22
|
+
requirement: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.3.11
|
27
|
+
type: :runtime
|
28
|
+
prerelease: false
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.3.11
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: jeweler
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
type: :development
|
42
|
+
prerelease: false
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: stomp
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: appraisal
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
type: :development
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
description: ActiveMessaging is an attempt to bring the simplicity and elegance of
|
77
|
+
rails development to the world of messaging. Messaging, (or event-driven architecture)
|
78
|
+
is widely used for enterprise integration, with frameworks such as Java's JMS, and
|
79
|
+
products such as ActiveMQ, Tibco, IBM MQSeries, etc. Now supporting Rails 3 as of
|
80
|
+
version 0.8.0.
|
81
|
+
email: activemessaging-discuss@googlegroups.com
|
82
|
+
executables: []
|
83
|
+
extensions: []
|
84
|
+
extra_rdoc_files:
|
85
|
+
- README.md
|
86
|
+
files:
|
87
|
+
- .travis.yml
|
88
|
+
- Appraisals
|
89
|
+
- Gemfile
|
90
|
+
- Gemfile.lock
|
91
|
+
- README.md
|
92
|
+
- Rakefile
|
93
|
+
- VERSION
|
94
|
+
- activemessaging.gemspec
|
95
|
+
- gemfiles/activesupport23.gemfile
|
96
|
+
- gemfiles/activesupport23.gemfile.lock
|
97
|
+
- gemfiles/activesupport30.gemfile
|
98
|
+
- gemfiles/activesupport30.gemfile.lock
|
99
|
+
- gemfiles/activesupport31.gemfile
|
100
|
+
- gemfiles/activesupport31.gemfile.lock
|
101
|
+
- gemfiles/activesupport32.gemfile
|
102
|
+
- gemfiles/activesupport32.gemfile.lock
|
103
|
+
- generators/a13g_test_harness/a13g_test_harness_generator.rb
|
104
|
+
- generators/a13g_test_harness/templates/active_messaging_test.rhtml
|
105
|
+
- generators/a13g_test_harness/templates/active_messaging_test_controller.rb
|
106
|
+
- generators/a13g_test_harness/templates/index.rhtml
|
107
|
+
- generators/filter/USAGE
|
108
|
+
- generators/filter/filter_generator.rb
|
109
|
+
- generators/filter/templates/filter.rb
|
110
|
+
- generators/filter/templates/filter_test.rb
|
111
|
+
- generators/processor/USAGE
|
112
|
+
- generators/processor/processor_generator.rb
|
113
|
+
- generators/processor/templates/application_processor.rb
|
114
|
+
- generators/processor/templates/broker.yml
|
115
|
+
- generators/processor/templates/jruby_poller
|
116
|
+
- generators/processor/templates/messaging.rb
|
117
|
+
- generators/processor/templates/poller
|
118
|
+
- generators/processor/templates/poller.rb
|
119
|
+
- generators/processor/templates/processor.rb
|
120
|
+
- generators/processor/templates/processor_test.rb
|
121
|
+
- generators/tracer/USAGE
|
122
|
+
- generators/tracer/templates/controller.rb
|
123
|
+
- generators/tracer/templates/helper.rb
|
124
|
+
- generators/tracer/templates/index.rhtml
|
125
|
+
- generators/tracer/templates/layout.rhtml
|
126
|
+
- generators/tracer/templates/trace_processor.rb
|
127
|
+
- generators/tracer/tracer_generator.rb
|
128
|
+
- init.rb
|
129
|
+
- lib/activemessaging.rb
|
130
|
+
- lib/activemessaging/adapter.rb
|
131
|
+
- lib/activemessaging/adapters/amqp.rb
|
132
|
+
- lib/activemessaging/adapters/asqs.rb
|
133
|
+
- lib/activemessaging/adapters/base.rb
|
134
|
+
- lib/activemessaging/adapters/beanstalk.rb
|
135
|
+
- lib/activemessaging/adapters/jms.rb
|
136
|
+
- lib/activemessaging/adapters/reliable_msg.rb
|
137
|
+
- lib/activemessaging/adapters/stomp.rb
|
138
|
+
- lib/activemessaging/adapters/synch.rb
|
139
|
+
- lib/activemessaging/adapters/test.rb
|
140
|
+
- lib/activemessaging/adapters/wmq.rb
|
141
|
+
- lib/activemessaging/base_message.rb
|
142
|
+
- lib/activemessaging/filter.rb
|
143
|
+
- lib/activemessaging/gateway.rb
|
144
|
+
- lib/activemessaging/message_sender.rb
|
145
|
+
- lib/activemessaging/named_base.rb
|
146
|
+
- lib/activemessaging/processor.rb
|
147
|
+
- lib/activemessaging/railtie.rb
|
148
|
+
- lib/activemessaging/test_helper.rb
|
149
|
+
- lib/activemessaging/threaded_poller.rb
|
150
|
+
- lib/activemessaging/trace_filter.rb
|
151
|
+
- lib/generators/active_messaging/install/USAGE
|
152
|
+
- lib/generators/active_messaging/install/install_generator.rb
|
153
|
+
- lib/generators/active_messaging/install/templates/application_processor.rb
|
154
|
+
- lib/generators/active_messaging/install/templates/broker.yml
|
155
|
+
- lib/generators/active_messaging/install/templates/poller
|
156
|
+
- lib/generators/active_messaging/install/templates/poller.rb
|
157
|
+
- lib/generators/active_messaging/install/templates/threaded_poller
|
158
|
+
- lib/generators/active_messaging/processor/USAGE
|
159
|
+
- lib/generators/active_messaging/processor/processor_generator.rb
|
160
|
+
- lib/generators/active_messaging/processor/templates/messaging.rb
|
161
|
+
- lib/generators/active_messaging/processor/templates/processor.rb
|
162
|
+
- lib/generators/active_messaging/processor/templates/processor_spec.rb
|
163
|
+
- lib/generators/active_messaging/processor/templates/processor_test.rb
|
164
|
+
- lib/tasks/start_consumers.rake
|
165
|
+
- poller.rb
|
166
|
+
- test/all_tests.rb
|
167
|
+
- test/app/config/broker.yml
|
168
|
+
- test/asqs_test.rb
|
169
|
+
- test/config_test.rb
|
170
|
+
- test/filter_test.rb
|
171
|
+
- test/gateway_test.rb
|
172
|
+
- test/jms_test.rb
|
173
|
+
- test/reliable_msg_test.rb
|
174
|
+
- test/stomp_test.rb
|
175
|
+
- test/test_helper.rb
|
176
|
+
- test/tracer_test.rb
|
177
|
+
homepage: http://github.com/kookster/activemessaging
|
178
|
+
licenses: []
|
179
|
+
metadata: {}
|
180
|
+
post_install_message:
|
181
|
+
rdoc_options: []
|
182
|
+
require_paths:
|
183
|
+
- lib
|
184
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
185
|
+
requirements:
|
186
|
+
- - ! '>='
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
version: '0'
|
189
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
190
|
+
requirements:
|
191
|
+
- - ! '>='
|
192
|
+
- !ruby/object:Gem::Version
|
193
|
+
version: '0'
|
194
|
+
requirements: []
|
195
|
+
rubyforge_project:
|
196
|
+
rubygems_version: 2.4.5
|
197
|
+
signing_key:
|
198
|
+
specification_version: 4
|
199
|
+
summary: Official activemessaging gem, now hosted on github.com/kookster. (kookster
|
200
|
+
prefix temporary)
|
201
|
+
test_files: []
|
202
|
+
has_rdoc:
|