On Sun, Apr 27, 2008 at 11:37 PM, pratibhaG <[EMAIL PROTECTED]> wrote:
>
>  Hi,
>  I have 3 SUs. One is a BC servicemix-jms, other two are SEs servicemix-bean,
>
>  I want to have a message flow like this:
>  servicemix-jms-->servicemix-bean-->servicemix-bean
>
>  When I tried only  servicemix-jms-->servicemix-bean by giving targetEndpoint
>  for servicemix-jms as servicemix-bean in Xbean.xml of servicemix-jms, it
>  worked.
>
>  Now how to go from servicemix-bean-->servicemix-bean?
>
>  I know that I can use eip or camel for that but is there any other way so
>  that I can avoid using eip or camel and still able to communicate between
>  two beans?

You will need to create a message exchange and send it. Below is a
rough example of this:

// Create an InOut exchange
MessageExchangeFactory exchangeFactory = chanel.createExchangeFactory();
InOut exchange = exchangeFactory.createInOutExchange();

// Using the QName for the target service and target endpoint name,
// configure the destination for the exchange
ServiceEndpoint se = context.getEndpoint(service, endpoint);
exchange.setEndpoint(se);

// Create a normalized message
NormalizedMessage in = identityExchange.createMessage();
in.setContent(support.createIdentityInMessage(msisdn, request));

// Set the normalized message on the exchange
exchange.setInMessage(in);

// Send the message
channel.sendSync(exchange);

// Grab the response
NormalizedMessage out = exchange.getOutMessage();
// Do something here with the out message

You can find other examples like this in the tests for the ServiceMix
project. You just have to dig around and find them.

Bruce
-- 
perl -e 'print unpack("u30","D0G)[EMAIL 
PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Reply via email to