Abdulrazak-Alkl / activemessaging

Automatically exported from code.google.com/p/activemessaging
0 stars 0 forks source link

Messages from VirtualTopics not dispatched #52

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a processor that subscribes to
/queue/Consumer.A.VirtualTopic.HelloWorld
2. Publish a message to /topic/VirtualTopic.HelloWorld

What is the expected output? What do you see instead?

I expect that the message is dispatched to the processor that was created
in step 1. It is not, because the ActiveMessaging::Subscription#matches?
returns false when it should return true.

What version of the product are you using? On what operating system?
Active Messaging 0.6.1 with Apache ActiveMQ 5.3.0 running on Mac OS X 10.6

Please provide any additional information below.
http://activemq.apache.org/virtual-destinations.html

I suspect that VirtualTopics is ActiveMQ specific, but I would love to see
it supported.

Original issue reported on code.google.com by maarten....@gmail.com on 14 Feb 2010 at 10:11

GoogleCodeExporter commented 8 years ago
Implemented support for subscribing to Virtual Topics.

Please note that if you want to both publish and subscribe to a VirtualTopic, 
you
have to define two destinations, eg:

ActiveMessaging::Gateway.define do |s|
  s.destination :some_virtual_topic, '/topic/VirtualTopic.Topic1'
  s.destination :some_virtual_topic_subscriber, '/queue/Consumer.A.VirtualTopic.Topic1'
end

You would use the first one for publishing, and the second one to subscribe to.

Original comment by maarten....@gmail.com on 28 Mar 2010 at 9:47

Attachments:

GoogleCodeExporter commented 8 years ago
This is a stomp specific fix. Works though, since early a13g code has a slant 
towards
stomp, this seems like the right place to do it as the code is currently 
organized.

A longer term fix would probably be to change the matches? method to delegate 
to the
broker specific adapter (perhaps a class level method on the appropriate 
adapter) so
that there can be stomp specific logic, amqp specific, etc.

Original comment by kooks...@gmail.com on 29 Mar 2010 at 10:02

GoogleCodeExporter commented 8 years ago
Hi Andrew,

Thanks for inspecting my patch.

I agree that the matches? method should be broker specific and hence part of 
broker
specific adapters. Then it would also be easier to implement a proper fix for 
issue 27.

I thought it would be to much to refactor on short term.

Would love to discuss how to properly implement a long term solution.

Maarten

Original comment by maarten....@gmail.com on 29 Mar 2010 at 10:08

GoogleCodeExporter commented 8 years ago
Agreed - shouldn't be too tough to update that method, and move the impl to the
adpaters.  We can put a default impl in the base adapter, and override in the 
stomp.rb.

Original comment by kooks...@gmail.com on 29 Mar 2010 at 10:17