You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Anthony <an...@rmb.co.za> on 2006/12/04 09:56:19 UTC

Content based router example please

hi guys,

i must admit that i'm a bit of a servicemix newb...

i've got a very simple proof of concept that i need to do:
1. get messages from input queue (active mq)
2. content based router then routes messages (based on some message content)
to 2 output queues (also active mq)

i had a look at 
http://incubator.apache.org/servicemix/main/servicemix-eip.html#servicemix-eip-ContentBasedrouter
CBR  and  http://www.servicemix.org/site/servicemix-jms.html JMS  but i
seriously need just a simple example of how to setup the individual
xbean.xml's to accomplish this task...

can anybody please point me to an example or email me with something that
they've already done that sorta does the same thing?

much appreciated!

anthony
-- 
View this message in context: http://www.nabble.com/Content-based-router-example-please-tf2750001s12049.html#a7672521
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Content based router example please

Posted by Anthony <an...@rmb.co.za>.
i got it working eventually:

input queue:
  <jms:endpoint service="rmb:jms-in"
                endpoint="endpoint"
                targetService="rmb:cbr"
                role="consumer"
                destinationStyle="queue"
                jmsProviderDestinationName="test.input.queue"
                connectionFactory="#connectionFactory" 
				defaultMep="http://www.w3.org/2004/08/wsdl/in-only" />

the cbr:
<eip:content-based-router service="rmb:cbr" endpoint="endpoint">
  <eip:rules>
    <eip:routing-rule>
      <eip:predicate>
        <eip:xpath-predicate xpath="count(/items) = 1" />
      </eip:predicate>
      <eip:target>
		<eip:exchange-target service="rmb:jms-out-1" />
      </eip:target>
    </eip:routing-rule>
    <eip:routing-rule>
      <!-- there is no predicate, so this is the default destination -->
      <eip:target>
        <eip:exchange-target service="rmb:jms-out-2" />
      </eip:target>
    </eip:routing-rule>
  </eip:rules>
</eip:content-based-router>

1'st output queue:
  <jms:endpoint service="rmb:jms-out-1"
                endpoint="endpoint"
                role="provider"
                destinationStyle="queue"
                jmsProviderDestinationName="test.output.queue.1"
                connectionFactory="#connectionFactory" />

2'nd output queue:
1'st output queue:
  <jms:endpoint service="rmb:jms-out-2"
                endpoint="endpoint"
                role="provider"
                destinationStyle="queue"
                jmsProviderDestinationName="test.output.queue.2"
                connectionFactory="#connectionFactory" />

thanks!
anthony


Anthony wrote:
> 
> hi guys,
> 
> i must admit that i'm a bit of a servicemix newb...
> 
> i've got a very simple proof of concept that i need to do:
> 1. get messages from input queue (active mq)
> 2. content based router then routes messages (based on some message
> content) to 2 output queues (also active mq)
> 
> i had a look at 
> http://incubator.apache.org/servicemix/main/servicemix-eip.html#servicemix-eip-ContentBasedrouter
> CBR  and  http://www.servicemix.org/site/servicemix-jms.html JMS  but i
> seriously need just a simple example of how to setup the individual
> xbean.xml's to accomplish this task...
> 
> can anybody please point me to an example or email me with something that
> they've already done that sorta does the same thing?
> 
> much appreciated!
> 
> anthony
> 

-- 
View this message in context: http://www.nabble.com/Content-based-router-example-please-tf2750001s12049.html#a7681764
Sent from the ServiceMix - User mailing list archive at Nabble.com.