You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by puli <ra...@amritatech.com> on 2008/01/04 07:17:29 UTC

Re: Little confused with the terminologies

Pls tel me if im wrong,

I wrote an ejb code and i have deployed it to jboss. The i have to write
service which will make a POJO call to the ejb. Then i have to write a
client application which can be servlet or anything which will give a
request for the service which we have created.

If im wrong pls tell me the right way. If you have any other easier solution
also pls enlighten with that one.



bsnyder wrote:
> 
> On Dec 19, 2007 10:45 PM, puli <ra...@amritatech.com> wrote:
>>
>> me created a su with the sericemix-bean component..
>> but again having doubt..
>> how can i do a POJO callout to EJB...
>> do i need to deploy ejb also to servicemix or i have to deploy it
>> somewhere
>> else?
>> where should i and how?
>> can u pls help me out..
> 
> You can make a call out to an EJB that is hosted external to
> ServiceMix via the POJO that you created that extends the
> MessageExchangeListener. In this POJO, you can use the Spring
> Framework APIs to make a call out to the externally hosted EJB. See
> the Spring Javadocs for more info:
> 
> http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/ejb/access/package-summary.html
> 
> 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/
> 
> 

-- 
View this message in context: http://www.nabble.com/Little-confused-with-the-terminologies-tp14370114s12049p14611475.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Little confused with the terminologies

Posted by Bruce Snyder <br...@gmail.com>.
On Jan 4, 2008 9:27 PM, puli <ra...@amritatech.com> wrote:
>
> Thank you for your detailed reply...
>
> i will try this one and let you know about the status.
>
> do we really need to use spring or is there any other way to implement this.
> Just for the knowledge transfer i am asking this question.

You can implement it any way you like. I suggested using Spring
because ServiceMix is built on top of Spring so you can use Spring
easily inside of the xbean.xml files in SUs. In fact, just about
anything you can do in Spring you can do in a xbean.xml file. Also,
using the Spring EJB APIs to invoke EJBs is the easiest manner in
which I've ever seen it done. I started using it back in 2003 to
invoke remote EJBs as well as to simplify the creation of EJBs. IMO,
the Spring EJB APIs are incredibly easy to use and vastly superior to
any other method of working with EJB 2.x beans that I've seen. I can't
speak for EJB 3.x as I haven't used it much.

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/

Re: Little confused with the terminologies

Posted by puli <ra...@amritatech.com>.
Thank you for your detailed reply...

i will try this one and let you know about the status.

do we really need to use spring or is there any other way to implement this.
Just for the knowledge transfer i am asking this question.


> Yeah this is what i meant and Thanx for your response.
>
> Then can u help me how can i write the POJO call out to EJB. Is there any
> sample available anywhere?

I'd use the Spring EJB APIs to achieve this:

http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/ejb/access/package-summary.html

For an example of using these APIs to invoke remote EJBs, see the
section named 'Accessing EJBs with Spring' in the following article:

http://www.javaworld.com/javaworld/jw-02-2005/jw-0214-springejb.html

The key is using the proxies to invoke the remote EJB.

> How can i write the client application?means how can i access the
> servicemix.

You will need to create some kind of Java application that will send a
XML message into the JBI container via some component. For example,
it's pretty easy to send messages using JMS so you could create a
small application that sends JMS messages to a JMS queue in the JBI
container and forwards the message along to your other components.
Below is an example component flow demonstrating this:

client application sends jms message --> servicemix-jms queue -->
(other components here) --> servicemix-bean POJO to invoke an EJB

This is just an example, but it's a good demonstration of how an EJB
can be invoked.

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/



-- 
View this message in context: http://www.nabble.com/Little-confused-with-the-terminologies-tp14370114s12049p14629906.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Little confused with the terminologies

Posted by Bruce Snyder <br...@gmail.com>.
On Jan 4, 2008 8:58 AM, puli <ra...@amritatech.com> wrote:
>
>
> Yeah this is what i meant and Thanx for your response.
>
> Then can u help me how can i write the POJO call out to EJB. Is there any
> sample available anywhere?

I'd use the Spring EJB APIs to achieve this:

http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/ejb/access/package-summary.html

For an example of using these APIs to invoke remote EJBs, see the
section named 'Accessing EJBs with Spring' in the following article:

http://www.javaworld.com/javaworld/jw-02-2005/jw-0214-springejb.html

The key is using the proxies to invoke the remote EJB.

> How can i write the client application?means how can i access the
> servicemix.

You will need to create some kind of Java application that will send a
XML message into the JBI container via some component. For example,
it's pretty easy to send messages using JMS so you could create a
small application that sends JMS messages to a JMS queue in the JBI
container and forwards the message along to your other components.
Below is an example component flow demonstrating this:

client application sends jms message --> servicemix-jms queue -->
(other components here) --> servicemix-bean POJO to invoke an EJB

This is just an example, but it's a good demonstration of how an EJB
can be invoked.

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/

Re: Little confused with the terminologies

Posted by puli <ra...@amritatech.com>.

Yeah this is what i meant and Thanx for your response.

Then can u help me how can i write the POJO call out to EJB. Is there any
sample available anywhere?

How can i write the client application?means how can i access the
servicemix.

plz help me.



bsnyder wrote:
> 
> On Jan 3, 2008 11:17 PM, puli <ra...@amritatech.com> wrote:
>>
>> Pls tel me if im wrong,
>>
>> I wrote an ejb code and i have deployed it to jboss. The i have to write
>> service which will make a POJO call to the ejb. Then i have to write a
>> client application which can be servlet or anything which will give a
>> request for the service which we have created.
>>
>> If im wrong pls tell me the right way. If you have any other easier
>> solution
>> also pls enlighten with that one.
> 
> This is a correct assessment. Based on what you described, you will
> create a component flow that looks like this:
> 
> client application --> smx-bean pojo --> JBoss EJB
> 
> Is this correct?
> 
> 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/
> 
> 

-- 
View this message in context: http://www.nabble.com/Little-confused-with-the-terminologies-tp14370114s12049p14619365.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Little confused with the terminologies

Posted by Bruce Snyder <br...@gmail.com>.
On Jan 3, 2008 11:17 PM, puli <ra...@amritatech.com> wrote:
>
> Pls tel me if im wrong,
>
> I wrote an ejb code and i have deployed it to jboss. The i have to write
> service which will make a POJO call to the ejb. Then i have to write a
> client application which can be servlet or anything which will give a
> request for the service which we have created.
>
> If im wrong pls tell me the right way. If you have any other easier solution
> also pls enlighten with that one.

This is a correct assessment. Based on what you described, you will
create a component flow that looks like this:

client application --> smx-bean pojo --> JBoss EJB

Is this correct?

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/