You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by kosalads <ko...@gmail.com> on 2013/09/30 12:44:11 UTC
Apache Camel - war project How to process the Queue and set to
another queue?
I have done a small app which connect to the camel war and do the processing
and set to another queue. However, when I process sample xml files it does
goes to the relevant queues and process. Unfortunately, when I use Bean
Object via camel It doesnt get updated in the 2nd queue.
If I explain bit more , This is how I have configured in the application
context which is in the camel war deployed in Jetty server.
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="activemq:inQ" />
<to uri="activemq:outQ" />
</route>
</camelContext>
<bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="brokerURL" value="tcp://localhost:61616" />
</bean>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="activemq:outQ" />
</route>
</camelContext>
I have crated three applications.
1. Standalone application which connect to the camel war and send the Pojo
Class to the Queue (inQ).
2. Camel war application which has above configuration. So when I pass the
Bean Object to the inQ it should send to the outQ
(Based on above configuration)
3. There is another application which reads the outQ and try to retrieve
Bean Object.
So what happens is that I could send the Pojo bean to the inQ but it doesnt
seems to be route to the outQ. So when I try to read from the outQ the queue
is empty.
Could you please let me know how we can handle above scenario and what is
the best way to handle this.
--
View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Apache Camel - war project How to process the Queue and set to
another queue?
Posted by James Carman <ja...@carmanconsulting.com>.
Serializable objects will be sent using a JMS ObjectMessage, not dropped on
the floor. No need for JSON serialization. That doesn't mean I don't
agree with you that an alternate serialized form should be used (see
previous comments).
On Friday, October 4, 2013, kraythe . wrote:
> You do know that JMS only accepts certain types right? Anything it doesn't
> understand, like your POJO, will get dropped on the floor. If you serialize
> your object to JSON before writing to the queue and then back from JSON
> when reading, it should work fine.
>
> *Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
> *Author of: Hardcore Java (2003) and Maintainable Java (2012)*
> *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39*
>
>
> On Thu, Oct 3, 2013 at 4:59 PM, James Carman <james@carmanconsulting.com<javascript:;>
> >wrote:
>
> > Are you sure? I thought "bean" was only a producer (or processor).
> > Anyway, the use case seems kind of silly and probably will lead to
> > mysterious things going on (like jms messages being stolen ;)
> >
> >
> > On Thu, Oct 3, 2013 at 5:44 PM, Christian Müller
> > <ch...@gmail.com> wrote:
> > > Maybe
> > > from
> > > bean
> > >
> > > is a valid route...
> > >
> > > Best,
> > > Christian
> > > Am 03.10.2013 17:46 schrieb "James Carman" <james@carmanconsulting.com
> >:
> > >
> > >> That second route with no "to" is "stealing" your messages, I'd guess.
> > >> I am actually surprised you're able to create a route with no "to."
> > >> I'm curious to play with that phenomenon in a test case.
> > >>
> > >> On Thu, Oct 3, 2013 at 11:36 AM, Andreas Gies <
> andreas@wayofquality.de>
> > >> wrote:
> > >> > Hi,
> > >> >
> > >> > it might be me, but I think your 2nd route is missing a to-element.
> > >> > You need to do something with message like drop it to a file or at
> > least
> > >> log
> > >> > it.
> > >> >
> > >> > Otherwise, like others have pointed out, using beans as payload is
> bad
> > >> > practice
> > >> > in integration applications. However, you seem to be happy with that
> > ...
> > >> >
> > >> > Best regards
> > >> > Andreas
> > >> >
> > >> >
> > >> > On 09/30/2013 12:44 PM, kosalads wrote:
> > >> >>
> > >> >> I have done a small app which connect to the camel war and do the
> > >> >> processing
> > >> >> and set to another queue. However, when I process sample xml files
> it
> > >> does
> > >> >> goes to the relevant queues and process. Unfortunately, when I use
> > Bean
> > >> >> Object via camel It doesnt get updated in the 2nd queue.
> > >> >>
> > >> >> If I explain bit more , This is how I have configured in the
> > application
> > >> >> context which is in the camel war deployed in Jetty server.
> > >> >>
> > >> >>
> > >> >> <camelContext xmlns="http://camel.apache.org/schema/spring">
> > >> >> <route>
> > >> >> <from uri="activemq:inQ" />
> > >> >> <to uri="activemq:outQ" />
> > >> >> </route>
> > >> >> </camelContext>
> > >> >>
> > >> >> <bean id="activemq"
> > >> >> class="org.apache.activemq.camel.component.ActiveMQComponent">
> > >> >> <property name="brokerURL" value="tcp://localhost:61616"
> />
> > >> >> </bean>
> > >> >>
> > >> >> <camelContext xmlns="
> http://camel.apache.org/schema/spring
> > ">
> > >> >> <route>
> > >> >> <from uri="activemq:outQ" />
> > >> >> </route>
> > >> >> </camelContext>
> > >> >>
> > >> >> I have crated three applications.
> > >> >>
> > >> >> 1. Standalone application which connect to the camel war and send
> the
> > >> Pojo
> > >> >> Class to the Queue (inQ).
> > >> >> 2. Camel war application which has above configuration. So when I
> > pass
> > >> the
> > >> >> Be
Re: Apache Camel - war project How to process the Queue and set to
another queue?
Posted by "kraythe ." <kr...@gmail.com>.
You do know that JMS only accepts certain types right? Anything it doesn't
understand, like your POJO, will get dropped on the floor. If you serialize
your object to JSON before writing to the queue and then back from JSON
when reading, it should work fine.
*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39*
On Thu, Oct 3, 2013 at 4:59 PM, James Carman <ja...@carmanconsulting.com>wrote:
> Are you sure? I thought "bean" was only a producer (or processor).
> Anyway, the use case seems kind of silly and probably will lead to
> mysterious things going on (like jms messages being stolen ;)
>
>
> On Thu, Oct 3, 2013 at 5:44 PM, Christian Müller
> <ch...@gmail.com> wrote:
> > Maybe
> > from
> > bean
> >
> > is a valid route...
> >
> > Best,
> > Christian
> > Am 03.10.2013 17:46 schrieb "James Carman" <ja...@carmanconsulting.com>:
> >
> >> That second route with no "to" is "stealing" your messages, I'd guess.
> >> I am actually surprised you're able to create a route with no "to."
> >> I'm curious to play with that phenomenon in a test case.
> >>
> >> On Thu, Oct 3, 2013 at 11:36 AM, Andreas Gies <an...@wayofquality.de>
> >> wrote:
> >> > Hi,
> >> >
> >> > it might be me, but I think your 2nd route is missing a to-element.
> >> > You need to do something with message like drop it to a file or at
> least
> >> log
> >> > it.
> >> >
> >> > Otherwise, like others have pointed out, using beans as payload is bad
> >> > practice
> >> > in integration applications. However, you seem to be happy with that
> ...
> >> >
> >> > Best regards
> >> > Andreas
> >> >
> >> >
> >> > On 09/30/2013 12:44 PM, kosalads wrote:
> >> >>
> >> >> I have done a small app which connect to the camel war and do the
> >> >> processing
> >> >> and set to another queue. However, when I process sample xml files it
> >> does
> >> >> goes to the relevant queues and process. Unfortunately, when I use
> Bean
> >> >> Object via camel It doesnt get updated in the 2nd queue.
> >> >>
> >> >> If I explain bit more , This is how I have configured in the
> application
> >> >> context which is in the camel war deployed in Jetty server.
> >> >>
> >> >>
> >> >> <camelContext xmlns="http://camel.apache.org/schema/spring">
> >> >> <route>
> >> >> <from uri="activemq:inQ" />
> >> >> <to uri="activemq:outQ" />
> >> >> </route>
> >> >> </camelContext>
> >> >>
> >> >> <bean id="activemq"
> >> >> class="org.apache.activemq.camel.component.ActiveMQComponent">
> >> >> <property name="brokerURL" value="tcp://localhost:61616" />
> >> >> </bean>
> >> >>
> >> >> <camelContext xmlns="http://camel.apache.org/schema/spring
> ">
> >> >> <route>
> >> >> <from uri="activemq:outQ" />
> >> >> </route>
> >> >> </camelContext>
> >> >>
> >> >> I have crated three applications.
> >> >>
> >> >> 1. Standalone application which connect to the camel war and send the
> >> Pojo
> >> >> Class to the Queue (inQ).
> >> >> 2. Camel war application which has above configuration. So when I
> pass
> >> the
> >> >> Bean Object to the inQ it should send to the outQ
> >> >> (Based on above configuration)
> >> >> 3. There is another application which reads the outQ and try to
> retrieve
> >> >> Bean Object.
> >> >>
> >> >> So what happens is that I could send the Pojo bean to the inQ but it
> >> >> doesnt
> >> >> seems to be route to the outQ. So when I try to read from the outQ
> the
> >> >> queue
> >> >> is empty.
> >> >>
> >> >> Could you please let me know how we can handle above scenario and
> what
> >> is
> >> >> the best way to handle this.
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524.html
> >> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >> >>
> >> >
> >>
>
Re: Apache Camel - war project How to process the Queue and set to
another queue?
Posted by James Carman <ja...@carmanconsulting.com>.
Are you sure? I thought "bean" was only a producer (or processor).
Anyway, the use case seems kind of silly and probably will lead to
mysterious things going on (like jms messages being stolen ;)
On Thu, Oct 3, 2013 at 5:44 PM, Christian Müller
<ch...@gmail.com> wrote:
> Maybe
> from
> bean
>
> is a valid route...
>
> Best,
> Christian
> Am 03.10.2013 17:46 schrieb "James Carman" <ja...@carmanconsulting.com>:
>
>> That second route with no "to" is "stealing" your messages, I'd guess.
>> I am actually surprised you're able to create a route with no "to."
>> I'm curious to play with that phenomenon in a test case.
>>
>> On Thu, Oct 3, 2013 at 11:36 AM, Andreas Gies <an...@wayofquality.de>
>> wrote:
>> > Hi,
>> >
>> > it might be me, but I think your 2nd route is missing a to-element.
>> > You need to do something with message like drop it to a file or at least
>> log
>> > it.
>> >
>> > Otherwise, like others have pointed out, using beans as payload is bad
>> > practice
>> > in integration applications. However, you seem to be happy with that ...
>> >
>> > Best regards
>> > Andreas
>> >
>> >
>> > On 09/30/2013 12:44 PM, kosalads wrote:
>> >>
>> >> I have done a small app which connect to the camel war and do the
>> >> processing
>> >> and set to another queue. However, when I process sample xml files it
>> does
>> >> goes to the relevant queues and process. Unfortunately, when I use Bean
>> >> Object via camel It doesnt get updated in the 2nd queue.
>> >>
>> >> If I explain bit more , This is how I have configured in the application
>> >> context which is in the camel war deployed in Jetty server.
>> >>
>> >>
>> >> <camelContext xmlns="http://camel.apache.org/schema/spring">
>> >> <route>
>> >> <from uri="activemq:inQ" />
>> >> <to uri="activemq:outQ" />
>> >> </route>
>> >> </camelContext>
>> >>
>> >> <bean id="activemq"
>> >> class="org.apache.activemq.camel.component.ActiveMQComponent">
>> >> <property name="brokerURL" value="tcp://localhost:61616" />
>> >> </bean>
>> >>
>> >> <camelContext xmlns="http://camel.apache.org/schema/spring">
>> >> <route>
>> >> <from uri="activemq:outQ" />
>> >> </route>
>> >> </camelContext>
>> >>
>> >> I have crated three applications.
>> >>
>> >> 1. Standalone application which connect to the camel war and send the
>> Pojo
>> >> Class to the Queue (inQ).
>> >> 2. Camel war application which has above configuration. So when I pass
>> the
>> >> Bean Object to the inQ it should send to the outQ
>> >> (Based on above configuration)
>> >> 3. There is another application which reads the outQ and try to retrieve
>> >> Bean Object.
>> >>
>> >> So what happens is that I could send the Pojo bean to the inQ but it
>> >> doesnt
>> >> seems to be route to the outQ. So when I try to read from the outQ the
>> >> queue
>> >> is empty.
>> >>
>> >> Could you please let me know how we can handle above scenario and what
>> is
>> >> the best way to handle this.
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524.html
>> >> Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>
>> >
>>
Re: Apache Camel - war project How to process the Queue and set to
another queue?
Posted by Christian Müller <ch...@gmail.com>.
Maybe
from
bean
is a valid route...
Best,
Christian
Am 03.10.2013 17:46 schrieb "James Carman" <ja...@carmanconsulting.com>:
> That second route with no "to" is "stealing" your messages, I'd guess.
> I am actually surprised you're able to create a route with no "to."
> I'm curious to play with that phenomenon in a test case.
>
> On Thu, Oct 3, 2013 at 11:36 AM, Andreas Gies <an...@wayofquality.de>
> wrote:
> > Hi,
> >
> > it might be me, but I think your 2nd route is missing a to-element.
> > You need to do something with message like drop it to a file or at least
> log
> > it.
> >
> > Otherwise, like others have pointed out, using beans as payload is bad
> > practice
> > in integration applications. However, you seem to be happy with that ...
> >
> > Best regards
> > Andreas
> >
> >
> > On 09/30/2013 12:44 PM, kosalads wrote:
> >>
> >> I have done a small app which connect to the camel war and do the
> >> processing
> >> and set to another queue. However, when I process sample xml files it
> does
> >> goes to the relevant queues and process. Unfortunately, when I use Bean
> >> Object via camel It doesnt get updated in the 2nd queue.
> >>
> >> If I explain bit more , This is how I have configured in the application
> >> context which is in the camel war deployed in Jetty server.
> >>
> >>
> >> <camelContext xmlns="http://camel.apache.org/schema/spring">
> >> <route>
> >> <from uri="activemq:inQ" />
> >> <to uri="activemq:outQ" />
> >> </route>
> >> </camelContext>
> >>
> >> <bean id="activemq"
> >> class="org.apache.activemq.camel.component.ActiveMQComponent">
> >> <property name="brokerURL" value="tcp://localhost:61616" />
> >> </bean>
> >>
> >> <camelContext xmlns="http://camel.apache.org/schema/spring">
> >> <route>
> >> <from uri="activemq:outQ" />
> >> </route>
> >> </camelContext>
> >>
> >> I have crated three applications.
> >>
> >> 1. Standalone application which connect to the camel war and send the
> Pojo
> >> Class to the Queue (inQ).
> >> 2. Camel war application which has above configuration. So when I pass
> the
> >> Bean Object to the inQ it should send to the outQ
> >> (Based on above configuration)
> >> 3. There is another application which reads the outQ and try to retrieve
> >> Bean Object.
> >>
> >> So what happens is that I could send the Pojo bean to the inQ but it
> >> doesnt
> >> seems to be route to the outQ. So when I try to read from the outQ the
> >> queue
> >> is empty.
> >>
> >> Could you please let me know how we can handle above scenario and what
> is
> >> the best way to handle this.
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524.html
> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>
> >
>
Re: Apache Camel - war project How to process the Queue and set to
another queue?
Posted by James Carman <ja...@carmanconsulting.com>.
That second route with no "to" is "stealing" your messages, I'd guess.
I am actually surprised you're able to create a route with no "to."
I'm curious to play with that phenomenon in a test case.
On Thu, Oct 3, 2013 at 11:36 AM, Andreas Gies <an...@wayofquality.de> wrote:
> Hi,
>
> it might be me, but I think your 2nd route is missing a to-element.
> You need to do something with message like drop it to a file or at least log
> it.
>
> Otherwise, like others have pointed out, using beans as payload is bad
> practice
> in integration applications. However, you seem to be happy with that ...
>
> Best regards
> Andreas
>
>
> On 09/30/2013 12:44 PM, kosalads wrote:
>>
>> I have done a small app which connect to the camel war and do the
>> processing
>> and set to another queue. However, when I process sample xml files it does
>> goes to the relevant queues and process. Unfortunately, when I use Bean
>> Object via camel It doesnt get updated in the 2nd queue.
>>
>> If I explain bit more , This is how I have configured in the application
>> context which is in the camel war deployed in Jetty server.
>>
>>
>> <camelContext xmlns="http://camel.apache.org/schema/spring">
>> <route>
>> <from uri="activemq:inQ" />
>> <to uri="activemq:outQ" />
>> </route>
>> </camelContext>
>>
>> <bean id="activemq"
>> class="org.apache.activemq.camel.component.ActiveMQComponent">
>> <property name="brokerURL" value="tcp://localhost:61616" />
>> </bean>
>>
>> <camelContext xmlns="http://camel.apache.org/schema/spring">
>> <route>
>> <from uri="activemq:outQ" />
>> </route>
>> </camelContext>
>>
>> I have crated three applications.
>>
>> 1. Standalone application which connect to the camel war and send the Pojo
>> Class to the Queue (inQ).
>> 2. Camel war application which has above configuration. So when I pass the
>> Bean Object to the inQ it should send to the outQ
>> (Based on above configuration)
>> 3. There is another application which reads the outQ and try to retrieve
>> Bean Object.
>>
>> So what happens is that I could send the Pojo bean to the inQ but it
>> doesnt
>> seems to be route to the outQ. So when I try to read from the outQ the
>> queue
>> is empty.
>>
>> Could you please let me know how we can handle above scenario and what is
>> the best way to handle this.
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
Re: Apache Camel - war project How to process the Queue and set to
another queue?
Posted by Andreas Gies <an...@wayofquality.de>.
Hi,
it might be me, but I think your 2nd route is missing a to-element.
You need to do something with message like drop it to a file or at least
log it.
Otherwise, like others have pointed out, using beans as payload is bad
practice
in integration applications. However, you seem to be happy with that ...
Best regards
Andreas
On 09/30/2013 12:44 PM, kosalads wrote:
> I have done a small app which connect to the camel war and do the processing
> and set to another queue. However, when I process sample xml files it does
> goes to the relevant queues and process. Unfortunately, when I use Bean
> Object via camel It doesnt get updated in the 2nd queue.
>
> If I explain bit more , This is how I have configured in the application
> context which is in the camel war deployed in Jetty server.
>
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> <route>
> <from uri="activemq:inQ" />
> <to uri="activemq:outQ" />
> </route>
> </camelContext>
>
> <bean id="activemq"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
> <property name="brokerURL" value="tcp://localhost:61616" />
> </bean>
>
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> <route>
> <from uri="activemq:outQ" />
> </route>
> </camelContext>
>
> I have crated three applications.
>
> 1. Standalone application which connect to the camel war and send the Pojo
> Class to the Queue (inQ).
> 2. Camel war application which has above configuration. So when I pass the
> Bean Object to the inQ it should send to the outQ
> (Based on above configuration)
> 3. There is another application which reads the outQ and try to retrieve
> Bean Object.
>
> So what happens is that I could send the Pojo bean to the inQ but it doesnt
> seems to be route to the outQ. So when I try to read from the outQ the queue
> is empty.
>
> Could you please let me know how we can handle above scenario and what is
> the best way to handle this.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Re: Apache Camel - war project How to process the Queue and set to
another queue?
Posted by James Carman <ja...@carmanconsulting.com>.
Have you tried turning up logging to see what's going on? Camel gets
very descriptive at DEBUG level
On Mon, Sep 30, 2013 at 11:17 AM, kosalads <ko...@gmail.com> wrote:
> Hi James,
>
> So how do we handle the below scenario with Camel?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524p5740574.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Apache Camel - war project How to process the Queue and set to
another queue?
Posted by kosalads <ko...@gmail.com>.
Hi James,
So how do we handle the below scenario with Camel?
--
View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524p5740574.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Apache Camel - war project How to process the Queue and set to
another queue?
Posted by James Carman <ja...@carmanconsulting.com>.
We're not saying you won't be able to do it. It will work, but you
will run into troubles down the road with your application and it
makes it less flexible.
Have you tried playing with a unit test (using embedded ActiveMQ)?
It's really easy to set up.
On Mon, Sep 30, 2013 at 8:50 AM, kosalads <ko...@gmail.com> wrote:
> Hi James,
>
> Please note that I was able to send the Java bean to the queue and read
> the same java bean from another application. So I dont think it will be a
> problem to do this.
>
> But my issue is that I cannot get the Java Object from one queue and set to
> another queue in the same application, So this is what I want to know how to
> handle this?
>
> Also assume I have a Object with multiple Array lists which has set of Java
> objects. So in this case how can I transfer these data through Apache camel
> as a one Object, If I have a once Java class which I can add all the objects
> then it is easy to transfer this Object through Camel ActiveMQ? Appreciate
> your thoughts on this.
>
>
> Thanks in advance.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524p5740554.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Apache Camel - war project How to process the Queue and set to
another queue?
Posted by kosalads <ko...@gmail.com>.
Hi James,
Please note that I was able to send the Java bean to the queue and read
the same java bean from another application. So I dont think it will be a
problem to do this.
But my issue is that I cannot get the Java Object from one queue and set to
another queue in the same application, So this is what I want to know how to
handle this?
Also assume I have a Object with multiple Array lists which has set of Java
objects. So in this case how can I transfer these data through Apache camel
as a one Object, If I have a once Java class which I can add all the objects
then it is easy to transfer this Object through Camel ActiveMQ? Appreciate
your thoughts on this.
Thanks in advance.
--
View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524p5740554.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Apache Camel - war project How to process the Queue and set to
another queue?
Posted by James Carman <ja...@carmanconsulting.com>.
Regardless of whether it's for an internal application, it' still not
wise to use a bean payload on a JMS queue. You can run into all sorts
of problems with serialization and you're making it virtually
impossible for non-java code to talk to your services.
On Mon, Sep 30, 2013 at 6:58 AM, kosalads <ko...@gmail.com> wrote:
> Hi,
>
> This is for internal Applications and those Objects are serialized and
> using the same class in the both side.
>
> Provided that above scenario how can I achieve this?
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524p5740530.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Apache Camel - war project How to process the Queue and set to
another queue?
Posted by kosalads <ko...@gmail.com>.
Hi,
This is for internal Applications and those Objects are serialized and
using the same class in the both side.
Provided that above scenario how can I achieve this?
--
View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524p5740530.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Apache Camel - war project How to process the Queue and set to
another queue?
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
I dont think its a good idea to use java beans over JMS. Then you have
a tight coupling with java code as message format. You would need to
have the same .class files on both the sender and receiver side.
Can you not use text messages or use some neutral binary format.
If you still want java beans, then make sure to have same .class files
on both sides (in both WARs etc)
On Mon, Sep 30, 2013 at 12:44 PM, kosalads <ko...@gmail.com> wrote:
> I have done a small app which connect to the camel war and do the processing
> and set to another queue. However, when I process sample xml files it does
> goes to the relevant queues and process. Unfortunately, when I use Bean
> Object via camel It doesnt get updated in the 2nd queue.
>
> If I explain bit more , This is how I have configured in the application
> context which is in the camel war deployed in Jetty server.
>
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> <route>
> <from uri="activemq:inQ" />
> <to uri="activemq:outQ" />
> </route>
> </camelContext>
>
> <bean id="activemq"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
> <property name="brokerURL" value="tcp://localhost:61616" />
> </bean>
>
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> <route>
> <from uri="activemq:outQ" />
> </route>
> </camelContext>
>
> I have crated three applications.
>
> 1. Standalone application which connect to the camel war and send the Pojo
> Class to the Queue (inQ).
> 2. Camel war application which has above configuration. So when I pass the
> Bean Object to the inQ it should send to the outQ
> (Based on above configuration)
> 3. There is another application which reads the outQ and try to retrieve
> Bean Object.
>
> So what happens is that I could send the Pojo bean to the inQ but it doesnt
> seems to be route to the outQ. So when I try to read from the outQ the queue
> is empty.
>
> Could you please let me know how we can handle above scenario and what is
> the best way to handle this.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen