1

I have a JMS publisher, which I cannot change (external system). This publisher publishes messages into some predefined JMS queue. I would like to design a multi-node subscriber system in which all subscribing nodes will receive a copy of each message (in my design, a subscriber node is able to realize if the message is targeted at this node by checking some property inside the message, so only one subscriber node will eventually process the message, while other subscriber nodes will discard their copies).

Changing the publisher system to use Topics could work flawlessly, but I cannot change the publisher.

Currently, I see two options to solve this:

  1. One option which can probably work is to use QueueBrowser, implement periodic polling which will read all messages and if the message is "mine", remove the message from queue and process. This is a huge overhead for such a simple problem.

  2. Another option is to write a dispatcher which subscribes to the queue and dispatches each message to multiple "internal" subscribers (e.g. as explained here: JMS - Going from one to multiple consumers). But this creates bottleneck in the dispatcher killing the whole scalability idea.

  3. A third option is to have multiple "intermediate" queue subscribers, each subscriber, when it receives a message, re-publishes it to a Topic for which the target subscribers will subscribe. This can work, but it's an extra hop in the flow, so not sure if the benefit (scalability) will be worth the loss (latency and complexity).

I wonder if there are any other ideas on how to solve this.

  • Can I have a subscriber listening to all topics ?
  • Can I configure JMS (WebLogic in my case) to auto-forward messages from queue to some topic?
  • Other options?

Thanks.

Community
  • 1
  • 1
Wanna Know All
  • 681
  • 2
  • 8
  • 18
  • With the Oracle Service Bus you can route Queues to Topics like you mentioned in #2 above. It's an optional piece of middleware that can be installed with Weblogic. It has all sorts of routing options for JMS and web services. http://www.orafmwschool.com/oracle-service-bus-routing-and-transformation/ – Display Name is missing Nov 22 '13 at 16:34
  • Interesting, looks like it can solve the problem. Thanks. If you want - please put it as an answer, so I can mark your answer. – Wanna Know All Nov 24 '13 at 10:16

2 Answers2

0
    Take a look at JMS routing using Apache CAMEL 


<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
 <!-- simple bridge from a topic to queue --> 
<route> 
<from uri="activemq:topic:topic.HelloWorld.incoming"> <to uri="activemq:queue:queue.HelloWorld"> 

</route>
 </camelContext>
  • Thanks. So, it's like my option #3, just implemented by setting up Apache Camel and configuring it, instead of writing my own routing using 5 lines of code, right? In other words, it is still an extra hop producing extra latency, if I understand correctly. – Wanna Know All Nov 22 '13 at 12:14
0

With the Oracle Service Bus you can route Queues to Topics like you mentioned in #2 above. It's an optional piece of middleware that can be installed with Weblogic. It has all sorts of routing options for JMS and web services.

Here is a quick look: http://www.orafmwschool.com/oracle-service-bus-routing-and-transformation/

http://www.slideshare.net/gschmutz/where-andwhentousetheoracleservicebusv2

We are using it for very much the same purpose that you're looking for.

Display Name is missing
  • 6,197
  • 3
  • 34
  • 46
  • Thanks. I wonder how much overhead/latency this dispatching/routing adds, in a case like mine. I mean, it's an extra hop in message route (latency) and it's a broadcast of a peer-to-peer message now to all target topic listeners (extra CPU/time/traffic/etc.). Have you measured these things? Thanks a lot. – Wanna Know All Dec 14 '13 at 10:43
  • 1
    We have done some load tests and measurements with/without the routing to make sure we can meet our requirements, trying to push over 500 msgs/sec at 1k each. Using the OSB for routing added around 8% extra overhead. – Display Name is missing Dec 16 '13 at 16:21