Hi Henk

Henk wrote:
Hi,

still looking into Servicemix for my scheduling needs, I would like to know whether it is possbile to send a message to different receivers. What I want to do is let a quartz component send a message to start multiple other components at the same time.
That way I can easily add a new 'job' to an already existing trigger.
Is this possible ? If yes, where should I look at ?  Routing somewhere ?

The current out of the box configuration in ServiceMix is to obey the JBI specification where invoking one service/interface endpoint will invoke a single component.

We'd like to make it easier for endpoints to 'subcribe' to the output of a component (such as a scheduler or file poller etc) which would make your use case much simpler to create. e.g. you can track this issue if you like...
http://jira.logicblaze.com/jira/browse/SM-35

Until then you can introduce an intermediate component which takes care of the routing. You could use a BPEL to invoke things in parallel, then when they've all completed, do something else or whatever. Or for more simpler requirements (like invoking things synchronously one after the other) you can just use the XPath Router...

http://servicemix.org/XPath+Router

You can then just have an XSLT document something like this...

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  xmlns:jbi="xalan://org.servicemix.components.xslt.XalanExtension"
  extension-element-prefixes="jbi"

  xmlns:foo="http://servicemix.org/cheese/";
  version="1.0">

  <xsl:template match="/*">

        <jbi:invoke service="foo:service1">
          <xsl:value-of select="/"/>
        </jbi:invoke>

        <jbi:invoke service="foo:service2">
          <xsl:value-of select="/"/>
        </jbi:invoke>

        <jbi:invoke service="foo:service3">
          <xsl:value-of select="/"/>
        </jbi:invoke>
  </xsl:template>

</xsl:stylesheet>



--

James
-------
http://radio.weblogs.com/0112098/

Reply via email to