You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by pratibhaG <pr...@in2m.com> on 2008/04/28 07:37:03 UTC

How one SE talks to other SE

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?

Thanks,
Pratibha
-- 
View this message in context: http://www.nabble.com/How-one-SE-talks-to-other-SE-tp16930337p16930337.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How one SE talks to other SE

Posted by kai0411 <jo...@softechnics.com>.
I'm new in this area like you, but this example might help.
http://tompurcellstechblog.blogspot.com/2008/01/routingslip200.html


pratibhaG 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?
> 
> Can one SE talk to other SE directly without using BC inbetween?
> 
> Thanks,
> Pratibha
> 

-- 
View this message in context: http://www.nabble.com/How-one-SE-talks-to-other-SE-tp16930337p16945886.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How one SE talks to other SE

Posted by Bruce Snyder <br...@gmail.com>.
On Sun, Apr 27, 2008 at 11:37 PM, pratibhaG <pr...@in2m.com> 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)U8V4\@4VYY9&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/