You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by nitingupta183 <ni...@gmail.com> on 2008/09/13 10:22:40 UTC

Usage of Camel to acheive MessageListner within an Application

Hi all,

I have recently heard about the Camel project. So far just tried a simple
POC and read some documents.

I want to use Camel to implement a MessageListner kind of infrastructure
within my application. In my application, there is one process which must be
updated each time a user changes his preference or set of preferences. I am
thinking of using Camel as a bridge between the Preferences and the other
process. This way I shall not be required to write extra lines of code to
implement this behaviour.

So few questions:
- Is it possible to do this?
- Is it possible to achieve this messaging between the 2 processes of the
same application without using JMS? I think JMS would be an overkill for
this.

Please let me know what options I can explore, if not Camel.

Regards,
Nitin
-- 
View this message in context: http://www.nabble.com/Usage-of-Camel-to-acheive-MessageListner-within-an-Application-tp19468474s22882p19468474.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Usage of Camel to acheive MessageListner within an Application

Posted by nitingupta183 <ni...@gmail.com>.
Hi Claus,

Thanks for the ride.

I also thought about the Direct and Seda components. But due to my limited
knowledge of JMS, I did not try Seda. But will do it now.

I will do these POCs and will share them with you.

Thanks again,
Nitin 
-- 
View this message in context: http://www.nabble.com/Usage-of-Camel-to-acheive-MessageListner-within-an-Application-tp19468474s22882p19469349.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Usage of Camel to acheive MessageListner within an Application

Posted by nitingupta183 <ni...@gmail.com>.
Hi Claus,

I tried the POC with SEDA and it was lot simpler than I thought. I think
this shall solve my purpose and I will be able to create a quick, fast
application.

Thanks for your suggestion. 

I enjoyed the ride with you. Do pick me up again, when you think you are
going to discover an interesting route on Camel :-)

Cheers,
Nitin
-- 
View this message in context: http://www.nabble.com/Usage-of-Camel-to-acheive-MessageListner-within-an-Application-tp19468474s22882p19470104.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Usage of Camel to acheive MessageListner within an Application

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Yeah a POC was what got me started as well with Camel. Well it was my "track potential OS in my spare time, but anyway..". Glad to have you on the ride.

Yes it's possible. You can have a producer sending the changed preference to a consumer. For transport of choice look at the component list:
http://activemq.apache.org/camel/components.html

I would suggest starting with the build in types in camel-core such as:
- direct  (sync)
- seda    (async)

These are for message exchanges within the same application. There is also a vm component for java vm-wide message exchanges.

You can check out the getting started tutorial:
http://activemq.apache.org/camel/walk-through-an-example.html

Here you use the direct/seda endpoints instead of file and jms


Annotations
===========
Camel 1.4 has a @MessageDriven annotation that can be used for any consumer (not just JMS as EJB MDB). In Camel 1.5 we also have a @Producer annotation, but you can use @EndpointInject in Camel 1.4 to inject and endpoint or even easier a ProducerTemplate to use for sending the message to the endpoint.

If you have the time checkout some of the tutorials:
http://activemq.apache.org/camel/tutorials.html

See this tutorial about annotations (in the bottom)
http://activemq.apache.org/camel/tutorial-axis-camel.html 


But crank some code to try getting the producer and consumer to "communicate". 



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: nitingupta183 [mailto:nitingupta183@gmail.com] 
Sent: 13. september 2008 10:23
To: camel-user@activemq.apache.org
Subject: Usage of Camel to acheive MessageListner within an Application


Hi all,

I have recently heard about the Camel project. So far just tried a simple
POC and read some documents.

I want to use Camel to implement a MessageListner kind of infrastructure
within my application. In my application, there is one process which must be
updated each time a user changes his preference or set of preferences. I am
thinking of using Camel as a bridge between the Preferences and the other
process. This way I shall not be required to write extra lines of code to
implement this behaviour.

So few questions:
- Is it possible to do this?
- Is it possible to achieve this messaging between the 2 processes of the
same application without using JMS? I think JMS would be an overkill for
this.

Please let me know what options I can explore, if not Camel.

Regards,
Nitin
-- 
View this message in context: http://www.nabble.com/Usage-of-Camel-to-acheive-MessageListner-within-an-Application-tp19468474s22882p19468474.html
Sent from the Camel - Users mailing list archive at Nabble.com.