torquebox-messaging 1.0.0-java → 1.0.1-java

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.
@@ -89,8 +89,11 @@ module javax.jms::Session
89
89
  # client. If no block is given then request is returned as the
90
90
  # response.
91
91
  def receive_and_publish(destination, options = {})
92
+ selector = "synchronous = 'true'"
93
+ selector = "#{selector} and (#{options[:selector]})" if options[:selector]
92
94
  receive_options = options.merge(:decode => false,
93
- :selector => "synchronous = 'true'")
95
+ :selector => selector)
96
+
94
97
  request = receive(destination, receive_options)
95
98
  unless request.nil?
96
99
  decoded_request = request.decode
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  module TorqueboxMessaging
2
- VERSION = '1.0.0'
3
- MAVEN_VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
+ MAVEN_VERSION = '1.0.1'
4
4
  end
5
5
  begin
6
6
  require 'java'
@@ -21,7 +21,7 @@ begin
21
21
  require File.dirname(__FILE__) + '/activation-1.1.jar'
22
22
  require File.dirname(__FILE__) + '/jaxb-api-2.1.9.jar'
23
23
  require File.dirname(__FILE__) + '/torquebox-base-spi.jar'
24
- require File.dirname(__FILE__) + '/jruby-complete-1.6.1.jar'
24
+ require File.dirname(__FILE__) + '/jruby-complete-1.6.2.jar'
25
25
  require File.dirname(__FILE__) + '/torquebox-base-metadata.jar'
26
26
  require File.dirname(__FILE__) + '/torquebox-base-core.jar'
27
27
  require File.dirname(__FILE__) + '/picketbox-bare-3.0.0.CR2.jar'
@@ -251,6 +251,34 @@ describe TorqueBox::Messaging::Destination do
251
251
  queue.destroy
252
252
  message.should eql( "PING" )
253
253
  end
254
+
255
+ it "should allow a selector to be passed" do
256
+ queue = TorqueBox::Messaging::Queue.new "/queues/publish_and_receive"
257
+ queue.start
258
+
259
+ response_thread = Thread.new {
260
+ queue.receive_and_publish( :timeout => 10000,
261
+ :selector => "age > 60 or tan = true" )
262
+ }
263
+
264
+ # Publish a non-synchronous message that should not match selector
265
+ queue.publish( "young and tan", :properties => { :age => 25, :tan => true } )
266
+ # Publish a synchronous message that should not match selector
267
+ queue.publish_and_receive( "young",
268
+ :timeout => 25,
269
+ :properties => { :age => 25 } )
270
+ # Publish a synchronous message that should match selector
271
+ message = queue.publish_and_receive( "wrinkled",
272
+ :timeout => 10000,
273
+ :properties => { :age => 65, :tan => true } )
274
+ message.should eql( "wrinkled" )
275
+ response_thread.join
276
+
277
+ # Drain any remaining messages off the queue
278
+ 2.times { queue.receive(:timeout => 10) }
279
+
280
+ queue.destroy
281
+ end
254
282
  end
255
283
 
256
284
  context "destination not ready" do
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: torquebox-messaging
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.0
5
+ version: 1.0.1
6
6
  platform: java
7
7
  authors: []
8
8
 
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-29 00:00:00 -04:00
13
+ date: 2011-05-25 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -21,7 +21,7 @@ dependencies:
21
21
  requirements:
22
22
  - - "="
23
23
  - !ruby/object:Gem::Version
24
- version: 1.0.0
24
+ version: 1.0.1
25
25
  type: :runtime
26
26
  version_requirements: *id001
27
27
  - !ruby/object:Gem::Dependency
@@ -32,7 +32,7 @@ dependencies:
32
32
  requirements:
33
33
  - - "="
34
34
  - !ruby/object:Gem::Version
35
- version: 1.0.0
35
+ version: 1.0.1
36
36
  type: :development
37
37
  version_requirements: *id002
38
38
  - !ruby/object:Gem::Dependency
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - "="
45
45
  - !ruby/object:Gem::Version
46
- version: 1.0.0
46
+ version: 1.0.1
47
47
  type: :development
48
48
  version_requirements: *id003
49
49
  - !ruby/object:Gem::Dependency
@@ -54,7 +54,7 @@ dependencies:
54
54
  requirements:
55
55
  - - "="
56
56
  - !ruby/object:Gem::Version
57
- version: 1.0.0
57
+ version: 1.0.1
58
58
  type: :runtime
59
59
  version_requirements: *id004
60
60
  - !ruby/object:Gem::Dependency
@@ -96,7 +96,7 @@ files:
96
96
  - lib/activation-1.1.jar
97
97
  - lib/jaxb-api-2.1.9.jar
98
98
  - lib/torquebox-base-spi.jar
99
- - lib/jruby-complete-1.6.1.jar
99
+ - lib/jruby-complete-1.6.2.jar
100
100
  - lib/torquebox-base-metadata.jar
101
101
  - lib/torquebox-base-core.jar
102
102
  - lib/picketbox-bare-3.0.0.CR2.jar