I have just fixed the problem with the CorrelationId,
which was not set correctly.  So now, I'm not sure
what this new feature really add compared to the route
method.

I think
  jbi.forward("urn:test", "service")
is the same as
  jbi.route("service:urn:test:service");


On 2/26/07, roman.stumm <[EMAIL PROTECTED]> wrote:

Hello,

if someone needs a forward implementation (based on the servicemix3.0 impl.
for drools2) that works with servicemix3.1 and drools3, here is an
implementation that works for us.

Just put it in a subclass of org.apache.servicemix.drools.model.JbiHelper

   public void forward(String globalpart, String localpart) throws
MessagingException {
        QName service = new QName(globalpart, localpart);
        DeliveryChannel channel = getChannel();
        MessageExchangeFactory factory =
channel.createExchangeFactoryForService(service);
        InOnly outExchange = factory.createInOnlyExchange();
        String processCorrelationId =
                (String)
getExchange().getProperty(JbiConstants.CORRELATION_ID);
        if (processCorrelationId != null) {
            outExchange.setProperty(JbiConstants.CORRELATION_ID,
processCorrelationId);
        }
        NormalizedMessage out = outExchange.createMessage();
        outExchange.setInMessage(out);

CopyTransformer.getInstance().transform(getExchange().getInternalExchange(),
                getExchange().getIn().getInternalMessage(), out);
        getChannel().send(outExchange);
    }
--
View this message in context: 
http://www.nabble.com/servicemix-3.1---migration-from-drools2---%3E-drools---how-to-forward--tf3122041s12049.html#a9154974
Sent from the ServiceMix - User mailing list archive at Nabble.com.




--
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/

Reply via email to