bmabey-rosetta_queue 0.1.3 → 0.2.0

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.
Files changed (41) hide show
  1. data/History.txt +23 -2
  2. data/README.rdoc +90 -18
  3. data/Rakefile +2 -2
  4. data/VERSION.yml +2 -2
  5. data/examples/sample_amqp_consumer.rb +35 -0
  6. data/examples/sample_amqp_fanout_consumer.rb +49 -0
  7. data/examples/sample_amqp_fanout_producer.rb +17 -0
  8. data/examples/sample_amqp_producer.rb +15 -0
  9. data/features/filtering.feature +5 -9
  10. data/features/messaging.feature +40 -0
  11. data/features/step_definitions/common_messaging_steps.rb +45 -0
  12. data/features/{messaging/step_definitions → step_definitions}/point_to_point_steps.rb +4 -12
  13. data/features/{messaging/step_definitions → step_definitions}/publish_subscribe_steps.rb +3 -3
  14. data/features/support/env.rb +1 -5
  15. data/lib/rosetta_queue/adapter.rb +14 -8
  16. data/lib/rosetta_queue/adapters/amqp.rb +21 -142
  17. data/lib/rosetta_queue/adapters/amqp_evented.rb +132 -0
  18. data/lib/rosetta_queue/adapters/amqp_synch.rb +117 -0
  19. data/lib/rosetta_queue/adapters/base.rb +1 -1
  20. data/lib/rosetta_queue/adapters/beanstalk.rb +3 -3
  21. data/lib/rosetta_queue/adapters/null.rb +2 -2
  22. data/lib/rosetta_queue/adapters/stomp.rb +7 -2
  23. data/lib/rosetta_queue/consumer.rb +8 -1
  24. data/lib/rosetta_queue/consumer_managers/base.rb +1 -1
  25. data/lib/rosetta_queue/filters.rb +1 -3
  26. data/lib/rosetta_queue/logger.rb +1 -1
  27. data/lib/rosetta_queue/producer.rb +2 -10
  28. data/lib/rosetta_queue/spec_helpers/helpers.rb +1 -1
  29. data/lib/rosetta_queue.rb +4 -1
  30. data/spec/rosetta_queue/adapter_spec.rb +46 -0
  31. data/spec/rosetta_queue/adapters/{amqp_spec.rb → amqp_synchronous_spec.rb} +109 -121
  32. data/spec/rosetta_queue/adapters/beanstalk_spec.rb +1 -1
  33. data/spec/rosetta_queue/adapters/null_spec.rb +1 -1
  34. data/spec/rosetta_queue/adapters/shared_adapter_behavior.rb +4 -4
  35. data/spec/rosetta_queue/adapters/shared_fanout_behavior.rb +7 -7
  36. data/spec/rosetta_queue/adapters/stomp_spec.rb +3 -3
  37. data/spec/rosetta_queue/consumer_spec.rb +25 -1
  38. data/spec/spec_helper.rb +3 -1
  39. metadata +18 -11
  40. data/features/messaging/point_to_point.feature +0 -30
  41. data/features/support/common_messaging_steps.rb +0 -28
@@ -1,14 +1,25 @@
1
1
  require File.dirname(__FILE__) + '/../../spec_helper'
2
2
  require File.dirname(__FILE__) + '/shared_adapter_behavior'
3
3
  require File.dirname(__FILE__) + '/shared_fanout_behavior'
4
- require 'rosetta_queue/adapters/amqp'
4
+
5
+ begin
6
+ require 'rosetta_queue/adapters/amqp_synch'
7
+ rescue LoadError => ex
8
+ if ex.message =~ /bunny/i
9
+ warn "--WARNING-- Skipping all of tha AmqpSynchAdapter code examples since bunny is not present. Install bunny if you need to be testing this adapter!"
10
+ else
11
+ raise ex
12
+ end
13
+ end
14
+
15
+ if defined? Bunny
5
16
 
6
17
  module RosettaQueue::Gateway
7
-
18
+
8
19
  describe "an exchange", :shared => true do
9
-
20
+
10
21
  describe "#do_exchange" do
11
-
22
+
12
23
  it "should filter the message and forward it to the handler" do
13
24
  when_receiving_exchange {
14
25
  ::RosettaQueue::Filters.should_receive(:process_receiving).with(@msg).and_return("Filtered Message")
@@ -18,20 +29,20 @@ module RosettaQueue::Gateway
18
29
  end
19
30
  end
20
31
 
21
- describe "Amqp adapter and components" do
32
+ describe "AmqpSynch adapter and components" do
22
33
 
23
34
  before(:each) do
24
35
  RosettaQueue.logger.stub!(:info)
25
36
  @msg = "Hello World!"
26
- @adapter = AmqpAdapter.new("foo", "bar", "localhost")
27
- @handler = mock("handler", :on_message => true, :destination => :foo)
37
+ @adapter = AmqpSynchAdapter.new({:user => "foo", :password => "bar", :host => "localhost"})
38
+ @handler = mock("handler", :on_message => true, :destination => :foo, :options_hash => {:durable => true})
28
39
  end
29
-
30
- describe AmqpAdapter do
40
+
41
+ describe AmqpSynchAdapter do
31
42
 
32
43
  before(:each) do
33
- @exchange_strategy = mock('DirectExchange', :do_single_exchange => @msg, :do_exchange => @msg, :send_message => true)
34
- DirectExchange.stub!(:new).and_return(@exchange_strategy)
44
+ @exchange_strategy = mock('DirectExchange', :receive_once => @msg, :receive => @msg, :send_message => true)
45
+ SynchExchange::DirectExchange.stub!(:new).and_return(@exchange_strategy)
35
46
  end
36
47
 
37
48
  it_should_behave_like "an adapter"
@@ -39,232 +50,209 @@ module RosettaQueue::Gateway
39
50
  describe "#receive_once" do
40
51
 
41
52
  def do_receiving_once
42
- @adapter.receive_once("/queue/foo", {:durable => false})
53
+ @adapter.receive_once("queue.foo", {:durable => false})
43
54
  end
44
-
55
+
45
56
  it "should pass destination and options to exchange strategy" do
46
57
  when_receiving_once {
47
- @exchange_strategy.should_receive(:do_single_exchange).with("/queue/foo", {:durable => false})
58
+ @exchange_strategy.should_receive(:receive_once).with("queue.foo")
48
59
  }
49
60
  end
50
-
61
+
51
62
  end
52
-
63
+
53
64
  describe "#receive_with" do
54
65
 
55
66
  def do_receiving_with_handler
56
67
  @adapter.receive_with(@handler)
57
68
  end
58
-
69
+
59
70
  before(:each) do
60
- @handler = mock("handler", :on_message => true, :destination => :foo)
71
+ @handler = mock("handler", :on_message => true, :destination => :foo, :options_hash => {:durable => true })
61
72
  end
62
73
 
63
74
  it "should pass message handler to exchange strategy" do
64
75
  when_receiving_with_handler {
65
- @exchange_strategy.should_receive(:do_exchange).with("/queue/foo", @handler)
76
+ @exchange_strategy.should_receive(:receive).with("foo", @handler)
66
77
  }
67
78
  end
68
79
 
69
80
  end
70
-
71
- describe "#send_message" do
81
+
82
+ describe "#send_message" do
72
83
 
73
84
  it "should pass message handler to exchange strategy" do
74
85
  when_publishing {
75
- @exchange_strategy.should_receive(:publish_to_exchange).with('queue', 'message', 'options')
86
+ @exchange_strategy.should_receive(:publish).with('queue', 'message')
76
87
  }
77
88
  end
78
-
89
+
79
90
  end
80
91
  end
81
92
 
82
93
 
83
- describe DirectExchange do
84
-
94
+ describe SynchExchange::DirectExchange do
95
+
85
96
  before(:each) do
86
- AMQP.stub!(:connect).and_return(@conn = mock("AMQP::Client"))
87
- @queue = mock("MQ::Queue", :pop => @msg, :publish => true, :unsubscribe => true)
88
- @channel = mock("MQ", :queue => @queue)
89
- MQ.stub!(:new).and_return(@channel)
97
+ @queue = mock("Bunny::Queue", :pop => @msg, :publish => true, :unsubscribe => true)
98
+ Bunny.stub!(:new).and_return(@conn = mock("Bunny::Client", :queue => @queue, :exchange => @exchange, :status => :connected))
90
99
  @queue.stub!(:subscribe).and_yield(@msg)
91
100
  @handler = mock("handler", :on_message => true, :destination => :foo)
92
- EM.stub!(:run).and_yield
93
- EM.stub!(:stop_event_loop)
94
- @strategy = DirectExchange.new('user', 'pass', 'host')
101
+ @exchange = SynchExchange::DirectExchange.new({:user => 'user', :password => 'pass', :host => 'host', :opts => {:vhost => "foo"}})
95
102
  end
96
-
97
-
103
+
104
+
98
105
  def do_receiving_exchange
99
- @strategy.do_exchange("/queue/foo", @handler)
106
+ @exchange.receive("queue.foo", @handler)
100
107
  end
101
-
108
+
102
109
  it_should_behave_like "an exchange"
103
-
104
- describe "#do_single_exchange" do
105
-
110
+
111
+ describe "#receive_once" do
112
+
106
113
  def do_receiving_single_exchange
107
- @strategy.do_single_exchange("/queue/foo", {:durable => false})
114
+ @exchange.receive_once("queue.foo") { |msg| }
115
+
108
116
  end
109
-
117
+
110
118
  it "should return the message from the connection" do
111
- @strategy.do_single_exchange("/queue/foo", {:durable => false}).should == @msg
119
+ @exchange.receive_once("queue.foo") do |msg|
120
+ msg.should == @msg
121
+ end
112
122
  end
113
-
123
+
114
124
  it "should subscribe to queue" do
115
125
  when_receiving_single_exchange {
116
126
  @queue.should_receive(:pop)
117
127
  }
118
128
  end
119
-
120
- # it "should stop event loop" do
121
- # pending
122
- # when_receiving_single_exchange {
123
- # EM.should_receive(:stop_event_loop)
124
- # }
125
- # end
126
-
129
+
127
130
  end
128
-
129
- describe "#do_exchange" do
131
+
132
+ describe "#receive" do
130
133
 
131
134
  it "should subscribe to queue" do
132
135
  when_receiving_exchange {
133
136
  @queue.should_receive(:subscribe).and_yield(@msg)
134
137
  }
135
- end
136
-
137
- end
138
-
139
-
140
- describe "#publish_to_exchange" do
141
-
142
- before(:each) do
143
- EM.stub!(:reactor_running?).and_return(true)
144
138
  end
145
-
139
+
140
+ end
141
+
142
+
143
+ describe "#publish" do
144
+
146
145
  def do_publishing
147
- @strategy.publish_to_exchange('/queue/foo', 'message', {:durable => false})
146
+ @exchange.publish('queue.foo', 'message')
148
147
  end
149
-
148
+
150
149
  it "should instantiate queue" do
151
150
  when_publishing {
152
- @channel.should_receive(:queue).and_return(@queue)
151
+ @conn.should_receive(:queue).and_return(@queue)
153
152
  }
154
153
  end
155
-
154
+
156
155
  it "should publish message to queue" do
157
156
  when_publishing {
158
- @channel.queue.should_receive(:publish).with('message', {:durable => false})
157
+ @conn.queue.should_receive(:publish).with("message", {})
159
158
  }
160
159
  end
161
-
162
- # it "should stop event loop" do
163
- # when_publishing {
164
- # EM.should_receive(:stop_event_loop)
165
- # }
166
- # end
160
+
167
161
  end
168
-
162
+
169
163
  end
170
-
171
-
172
- describe FanoutExchange do
173
-
164
+
165
+
166
+ describe SynchExchange::FanoutExchange do
167
+
174
168
  before(:each) do
175
- AMQP.stub!(:connect).and_return(@conn = mock("AMQP::Client"))
176
- @queue = mock("MQ::Queue", :pop => @msg, :bind => @bound_queue = mock("MQ::Queue", :pop => @msg), :publish => true, :unbind => true)
177
- @channel = mock("MQ", :queue => @queue, :fanout => 'fanout')
178
- MQ.stub!(:new).and_return(@channel)
179
- @bound_queue.stub!(:subscribe).and_yield(@msg)
169
+ @exchange = SynchExchange::FanoutExchange.new({:user => 'user', :password => 'pass', :host => 'host', :opts => {:vhost => 'foo'}})
170
+ @queue = mock("Bunny::Queue", :pop => @msg, :bind => @bound_queue = mock("Bunny::Queue", :pop => @msg), :publish => true, :unbind => true)
171
+ Bunny.stub!(:new).and_return(@conn = mock("Bunny::Client", :queue => @queue, :exchange => @exchange, :status => :connected))
172
+ @queue.stub!(:subscribe).and_yield(@msg)
180
173
  @handler = mock("handler", :on_message => true, :destination => :foo, :options => {:durable => false})
181
- EM.stub!(:run).and_yield
182
- EM.stub!(:stop_event_loop)
183
- @strategy = FanoutExchange.new('user', 'pass', 'host')
184
174
  end
185
-
175
+
186
176
  def do_receiving_exchange
187
- @strategy.do_exchange("/topic/foo", @handler)
177
+ @exchange.receive("topic.foo", @handler)
188
178
  end
189
-
179
+
190
180
  it_should_behave_like "an exchange"
191
-
192
- describe "#do_single_exchange" do
193
-
181
+
182
+ describe "#receive_once" do
183
+
194
184
  def do_receiving_exchange
195
- @strategy.do_single_exchange("/topic/foo")
185
+ @exchange.receive_once("topic.foo") { |msg| }
196
186
  end
197
-
187
+
198
188
  it_should_behave_like "a fanout exchange adapter"
199
-
189
+
200
190
  it "should return the message from the connection" do
201
- @strategy.do_single_exchange("/topic/foo").should == @msg
191
+ @exchange.receive_once("topic.foo") do |msg|
192
+ msg.should == @msg
193
+ end
202
194
  end
203
-
195
+
204
196
  it "should subscribe to queue" do
205
197
  when_receiving_exchange {
206
- @bound_queue.should_receive(:pop)
198
+ @queue.should_receive(:pop)
207
199
  }
208
200
  end
209
-
201
+
210
202
  it "should unbind queue from exchange" do
211
203
  pending
212
204
  when_receiving_single_exchange {
213
205
  @queue.should_receive(:unbind)
214
206
  }
215
207
  end
216
-
217
- it "should stop event loop" do
218
- pending
219
- when_receiving_single_exchange {
220
- EM.should_receive(:stop_event_loop)
221
- }
222
- end
208
+
223
209
  end
224
-
225
- describe "#do_exchange" do
226
-
210
+
211
+ describe "#receive" do
212
+
227
213
  it_should_behave_like "a fanout exchange adapter"
228
-
214
+
229
215
  it "should forward the message body onto the handler" do
230
216
  when_receiving_exchange {
231
217
  @handler.should_receive(:on_message).with("Hello World!")
232
218
  }
233
219
  end
234
-
220
+
235
221
  it "should subscribe to queue" do
236
222
  when_receiving_exchange {
237
- @bound_queue.should_receive(:subscribe).and_yield(@msg)
223
+ @queue.should_receive(:subscribe).and_yield(@msg)
238
224
  }
239
225
  end
240
-
226
+
241
227
  end
242
-
228
+
243
229
  # describe "#publish_to_exchange" do
244
- #
230
+ #
245
231
  # def do_publishing
246
- # @strategy.publish_to_exchange('/queue/foo', 'message', {:durable => false})
232
+ # @exchange.publish_to_exchange('/queue/foo', 'message', {:durable => false})
247
233
  # end
248
- #
234
+ #
249
235
  # it "should instantiate queue" do
250
236
  # when_publishing {
251
237
  # @channel.should_receive(:queue).and_return(@queue)
252
238
  # }
253
239
  # end
254
- #
240
+ #
255
241
  # it "should publish message to queue" do
256
242
  # when_publishing {
257
243
  # @channel.queue.should_receive(:publish).with('message')
258
244
  # }
259
245
  # end
260
- #
246
+ #
261
247
  # it "should stop event loop" do
262
248
  # when_publishing {
263
249
  # EM.should_receive(:stop_event_loop)
264
250
  # }
265
251
  # end
266
252
  # end
267
-
253
+
268
254
  end
269
255
  end
270
256
  end
257
+
258
+ end # for Guard up top to prevent this spec from running if Bunny not loaded from amqp_synch
@@ -13,7 +13,7 @@ module RosettaQueue
13
13
  @msg_obj = mock("message", :body => @msg, :delete => true)
14
14
  @conn = mock("Beanstalk::Pool", :put => true, :reserve => @msg_obj)
15
15
  ::Beanstalk::Pool.stub!(:new).and_return(@conn)
16
- @adapter = BeanstalkAdapter.new("user", "password", "host", "port")
16
+ @adapter = BeanstalkAdapter.new({:host => "host", :port => "port"})
17
17
  @adapter.stub!(:running).and_yield
18
18
  end
19
19
 
@@ -8,7 +8,7 @@ module RosettaQueue
8
8
  describe NullAdapter do
9
9
 
10
10
  def null_adapter
11
- NullAdapter.new('user', 'password', 'host', 'port')
11
+ NullAdapter.new({:user => 'user', :password => 'password', :host => 'host', :port => 'port'})
12
12
  end
13
13
 
14
14
  %w[disconnect receive receive_with send_message subscribe unsubscribe].each do |adapter_method|
@@ -4,7 +4,7 @@ module RosettaQueue
4
4
  describe "an adapter", :shared => true do
5
5
 
6
6
  before(:each) do
7
- ::RosettaQueue::Destinations.stub!(:lookup).and_return("/queue/foo")
7
+ ::RosettaQueue::Destinations.stub!(:lookup).and_return("foo")
8
8
  end
9
9
 
10
10
  def do_publishing
@@ -18,7 +18,7 @@ module RosettaQueue
18
18
  describe "#receive_once" do
19
19
 
20
20
  it "should return the message from the connection" do
21
- @adapter.receive_once("/queue/foo", {:persistent => false}).should == @msg
21
+ @adapter.receive_once("foo", {:persistent => false}).should == @msg
22
22
  end
23
23
 
24
24
  end
@@ -27,7 +27,7 @@ module RosettaQueue
27
27
 
28
28
  it "should look up the destination defined on the class" do
29
29
  when_receiving_with_handler {
30
- Destinations.should_receive(:lookup).with(:foo).and_return("/queue/foo")
30
+ Destinations.should_receive(:lookup).with(:foo).and_return("foo")
31
31
  }
32
32
  end
33
33
 
@@ -35,4 +35,4 @@ module RosettaQueue
35
35
 
36
36
  end
37
37
  end
38
- end
38
+ end
@@ -3,18 +3,18 @@ module RosettaQueue
3
3
 
4
4
  describe "a fanout exchange adapter", :shared => true do
5
5
 
6
- it "should discover fanout name for destation" do
7
- when_receiving_exchange {
8
- @channel.should_receive(:fanout).with('/foo').and_return(@bound_queue)
9
- }
10
- end
6
+ # it "should discover fanout name for destation" do
7
+ # when_receiving_exchange {
8
+ # @channel.should_receive(:fanout).with(@exchange).and_return(@bound_queue)
9
+ # }
10
+ # end
11
11
 
12
12
  it "should bind to fanout exchange" do
13
13
  when_receiving_exchange {
14
- @queue.should_receive(:bind).with('fanout').and_return(@bound_queue)
14
+ @queue.should_receive(:bind).with(@exchange).and_return(@bound_queue)
15
15
  }
16
16
  end
17
17
 
18
18
  end
19
19
  end
20
- end
20
+ end
@@ -13,7 +13,7 @@ module RosettaQueue
13
13
  @msg_obj = mock("message", :body => @msg, :headers => {"message-id" => 2})
14
14
  @conn = mock("Stomp::Connection", :ack => true, :send => true, :subscribe => true, :receive => @msg_obj, :unsubscribe => true, :disconnect => true)
15
15
  ::Stomp::Connection.stub!(:open).and_return(@conn)
16
- @adapter = StompAdapter.new("user", "password", "host", "port")
16
+ @adapter = StompAdapter.new({:user => "user", :password => "password", :host => "host", :port => "port"})
17
17
  @adapter.stub!(:running).and_yield
18
18
  end
19
19
 
@@ -56,7 +56,7 @@ module RosettaQueue
56
56
 
57
57
  it "should subscribe to queue defined by the class with the options defined on the class" do
58
58
  when_receiving_with_handler {
59
- @conn.should_receive("subscribe").with('/queue/foo', :persistent => false, :ack => "client")
59
+ @conn.should_receive("subscribe").with('foo', :persistent => false, :ack => "client")
60
60
  }
61
61
  end
62
62
 
@@ -89,7 +89,7 @@ module RosettaQueue
89
89
 
90
90
  it "should unsubscribe connection" do
91
91
  when_disconnecting {
92
- @conn.should_receive("unsubscribe").with("/queue/foo")
92
+ @conn.should_receive("unsubscribe").with("foo")
93
93
  }
94
94
  end
95
95
 
@@ -47,6 +47,30 @@ module RosettaQueue
47
47
  end
48
48
 
49
49
 
50
+ describe ".delete" do
51
+
52
+ before(:each) do
53
+ @adapter.stub!(:delete)
54
+ Destinations.stub!(:lookup).and_return("/queue/foo")
55
+ end
56
+
57
+ it "should look up the destination" do
58
+ # expect
59
+ Destinations.should_receive(:lookup).with(:test_queue_passed_in).and_return("/queue/foo")
60
+
61
+ # when
62
+ Consumer.delete(:test_queue_passed_in)
63
+ end
64
+
65
+ it "should delegate to the adapter" do
66
+ # expect
67
+ @adapter.should_receive(:delete).with("/queue/foo", {})
68
+
69
+ # when
70
+ Consumer.delete(:test_queue_passed_in)
71
+ end
72
+ end
73
+
50
74
  describe ".receive" do
51
75
 
52
76
  def when_receiving
@@ -72,4 +96,4 @@ module RosettaQueue
72
96
  end
73
97
 
74
98
  end
75
- end
99
+ end
data/spec/spec_helper.rb CHANGED
@@ -10,13 +10,15 @@ require 'rosetta_queue/adapters/null'
10
10
  require 'rosetta_queue/adapters/fake'
11
11
  require 'rosetta_queue/adapters/stomp'
12
12
  require 'rosetta_queue/adapters/amqp'
13
+ require 'rosetta_queue/consumer_managers/base'
14
+ require 'rosetta_queue/consumer_managers/evented'
15
+ require 'rosetta_queue/consumer_managers/threaded'
13
16
  require 'rosetta_queue/spec_helpers'
14
17
  require 'rosetta_queue/consumer_managers/base'
15
18
  require 'rosetta_queue/consumer_managers/evented'
16
19
  require 'rosetta_queue/consumer_managers/threaded'
17
20
  require File.dirname(__FILE__) + '/rosetta_queue/shared_messaging_behavior.rb'
18
21
 
19
-
20
22
  class NullLogger
21
23
  def info(*args); end
22
24
  def debug(*args); end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bmabey-rosetta_queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Mabey
@@ -10,12 +10,12 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-07-14 00:00:00 -07:00
13
+ date: 2009-07-28 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies: []
16
16
 
17
17
  description: Messaging gateway API with adapters for many messaging systems available in Ruby. Messaging systems can be easily switched out with a small configuration change. Code for testing on the object and application level is also provided.
18
- email: ben@benmabey.com
18
+ email: cbwyckoff@gmail.com
19
19
  executables: []
20
20
 
21
21
  extensions: []
@@ -31,16 +31,18 @@ files:
31
31
  - VERSION.yml
32
32
  - cucumber.yml
33
33
  - features/filtering.feature
34
- - features/messaging/point_to_point.feature
35
- - features/messaging/step_definitions/point_to_point_steps.rb
36
- - features/messaging/step_definitions/publish_subscribe_steps.rb
34
+ - features/messaging.feature
35
+ - features/step_definitions/common_messaging_steps.rb
37
36
  - features/step_definitions/filtering_steps.rb
38
- - features/support/common_messaging_steps.rb
37
+ - features/step_definitions/point_to_point_steps.rb
38
+ - features/step_definitions/publish_subscribe_steps.rb
39
39
  - features/support/env.rb
40
40
  - features/support/sample_consumers.rb
41
41
  - lib/rosetta_queue.rb
42
42
  - lib/rosetta_queue/adapter.rb
43
43
  - lib/rosetta_queue/adapters/amqp.rb
44
+ - lib/rosetta_queue/adapters/amqp_evented.rb
45
+ - lib/rosetta_queue/adapters/amqp_synch.rb
44
46
  - lib/rosetta_queue/adapters/base.rb
45
47
  - lib/rosetta_queue/adapters/beanstalk.rb
46
48
  - lib/rosetta_queue/adapters/fake.rb
@@ -63,7 +65,7 @@ files:
63
65
  - lib/rosetta_queue/spec_helpers/helpers.rb
64
66
  - lib/rosetta_queue/spec_helpers/publishing_matchers.rb
65
67
  - spec/rosetta_queue/adapter_spec.rb
66
- - spec/rosetta_queue/adapters/amqp_spec.rb
68
+ - spec/rosetta_queue/adapters/amqp_synchronous_spec.rb
67
69
  - spec/rosetta_queue/adapters/beanstalk_spec.rb
68
70
  - spec/rosetta_queue/adapters/fake_spec.rb
69
71
  - spec/rosetta_queue/adapters/null_spec.rb
@@ -82,7 +84,8 @@ files:
82
84
  - spec/spec.opts
83
85
  - spec/spec_helper.rb
84
86
  has_rdoc: false
85
- homepage: http://github.com/bmabey/rosetta_queue
87
+ homepage: http://github.com/cwyckoff/rosetta_queue
88
+ licenses:
86
89
  post_install_message:
87
90
  rdoc_options:
88
91
  - --charset=UTF-8
@@ -103,13 +106,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
106
  requirements: []
104
107
 
105
108
  rubyforge_project: rosetta-queue
106
- rubygems_version: 1.2.0
109
+ rubygems_version: 1.3.5
107
110
  signing_key:
108
111
  specification_version: 3
109
112
  summary: Messaging gateway API with adapters for many messaging systems available in Ruby.
110
113
  test_files:
111
114
  - spec/rosetta_queue/adapter_spec.rb
112
- - spec/rosetta_queue/adapters/amqp_spec.rb
115
+ - spec/rosetta_queue/adapters/amqp_synchronous_spec.rb
113
116
  - spec/rosetta_queue/adapters/beanstalk_spec.rb
114
117
  - spec/rosetta_queue/adapters/fake_spec.rb
115
118
  - spec/rosetta_queue/adapters/null_spec.rb
@@ -126,3 +129,7 @@ test_files:
126
129
  - spec/rosetta_queue/producer_spec.rb
127
130
  - spec/rosetta_queue/shared_messaging_behavior.rb
128
131
  - spec/spec_helper.rb
132
+ - examples/sample_amqp_consumer.rb
133
+ - examples/sample_amqp_fanout_consumer.rb
134
+ - examples/sample_amqp_fanout_producer.rb
135
+ - examples/sample_amqp_producer.rb
@@ -1,30 +0,0 @@
1
- Story: Point-to-Point Producing and Consuming
2
-
3
- As a RosettaQueue user
4
- I want to publish and consume point-to-point using various messaging protocols
5
- So that I can reliably integrate my systems with a message broker
6
-
7
- Scenario Outline: Point-to-Point
8
- Given RosettaQueue is configured for '<Adapter>'
9
- And a point-to-point destination is set
10
- When a message is published to queue 'foo'
11
- Then the message should be consumed
12
-
13
- Examples:
14
- | Adapter |
15
- | amqp |
16
- | stomp |
17
- | beanstalk |
18
-
19
-
20
- # Scenario Outline: Publish-Subscribe
21
- # Given RosettaQueue is configured for '<Adapter>'
22
- # And a publish-subscribe destination is set
23
- # When a message is published to topic foobar
24
- # Then multiple messages should be consumed from the topic
25
- #
26
- # Examples:
27
- # | Adapter |
28
- # | amqp |
29
- # # | stomp |
30
- # #