Request Response

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Request Response

Prachi Munjal
Hi, I have started using Active mq just few days back. what i am trying to make is a request response program in Java using Active Mq. Both Producer and consumer implements a message listener and my producer sends a message on a queue which is received by the consumer, Producer also creates a temporary queue and sets setJMSReplyTo property of the message before sending it. Consumer then creates a response and send it back to producer (on the temporary queue set by the producer) but producer does not receive it. Also when i re-start the consumer again without stopping the activemq the consumer receives the same msgs again that were sent to it in the previous run. I have set durability and persistence as False. Please suggest me a solution for these 2 problems. Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: Request Response

James Strachan-2
Sounds like you are not using either auto-acknowledgement, message
acknowledgement or transactions.

Until you are a bit more comfortable with the JMS API you might wanna
try Lingo which hides the JMS API from you behind a simple POJO API

http://lingo.codehaus.org/

On 12/12/06, Prachi Munjal <[hidden email]> wrote:

>
> Hi, I have started using Active mq just few days back. what i am trying to
> make is a request response program in Java using Active Mq.
> Both Producer and consumer implements a message listener and my producer
> sends a message on a queue which is received by the consumer, Producer also
> creates a temporary queue and sets setJMSReplyTo property of the message
> before sending it. Consumer then creates a response and send it back to
> producer (on the temporary queue set by the producer) but producer does not
> receive it.
>
> Also when i re-start the consumer again without stopping the activemq the
> consumer receives the same msgs again that were sent to it in the previous
> run. I have set durability and persistence as False. Please suggest me a
> solution for these 2 problems.
>
> Thanks in advance.
> --
> View this message in context: http://www.nabble.com/Request-Response-tf2808416.html#a7836102
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/
Reply | Threaded
Open this post in threaded view
|

Re: Request Response

Prachi Munjal
Hi, Actually we have to use Active Mq and no other wrapper implementation. It will be great if you couls help me working with this. I am setting the acknowledgement mode for the session and also doing setReplyTo().
Cheers
Prachi

James.Strachan wrote
Sounds like you are not using either auto-acknowledgement, message
acknowledgement or transactions.

Until you are a bit more comfortable with the JMS API you might wanna
try Lingo which hides the JMS API from you behind a simple POJO API

http://lingo.codehaus.org/

On 12/12/06, Prachi Munjal <prachi_munjal@agilent.com> wrote:
>
> Hi, I have started using Active mq just few days back. what i am trying to
> make is a request response program in Java using Active Mq.
> Both Producer and consumer implements a message listener and my producer
> sends a message on a queue which is received by the consumer, Producer also
> creates a temporary queue and sets setJMSReplyTo property of the message
> before sending it. Consumer then creates a response and send it back to
> producer (on the temporary queue set by the producer) but producer does not
> receive it.
>
> Also when i re-start the consumer again without stopping the activemq the
> consumer receives the same msgs again that were sent to it in the previous
> run. I have set durability and persistence as False. Please suggest me a
> solution for these 2 problems.
>
> Thanks in advance.
> --
> View this message in context: http://www.nabble.com/Request-Response-tf2808416.html#a7836102
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/
Reply | Threaded
Open this post in threaded view
|

Re: Request Response

garima015
can u send the code u have written for Consumer and producer. Because i just have implemented the same thing and is working fine.May be i can help u.

Prachi Munjal wrote
Hi, Actually we have to use Active Mq and no other wrapper implementation. It will be great if you couls help me working with this. I am setting the acknowledgement mode for the session and also doing setReplyTo().
Cheers
Prachi

James.Strachan wrote
Sounds like you are not using either auto-acknowledgement, message
acknowledgement or transactions.

Until you are a bit more comfortable with the JMS API you might wanna
try Lingo which hides the JMS API from you behind a simple POJO API

http://lingo.codehaus.org/

On 12/12/06, Prachi Munjal <prachi_munjal@agilent.com> wrote:
>
> Hi, I have started using Active mq just few days back. what i am trying to
> make is a request response program in Java using Active Mq.
> Both Producer and consumer implements a message listener and my producer
> sends a message on a queue which is received by the consumer, Producer also
> creates a temporary queue and sets setJMSReplyTo property of the message
> before sending it. Consumer then creates a response and send it back to
> producer (on the temporary queue set by the producer) but producer does not
> receive it.
>
> Also when i re-start the consumer again without stopping the activemq the
> consumer receives the same msgs again that were sent to it in the previous
> run. I have set durability and persistence as False. Please suggest me a
> solution for these 2 problems.
>
> Thanks in advance.
> --
> View this message in context: http://www.nabble.com/Request-Response-tf2808416.html#a7836102
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/
Reply | Threaded
Open this post in threaded view
|

Re: Request Response

Prachi Munjal
Hi ! Thanks , it worked. the mistake that i was doing was that i had message listeners at both the ends. now i removed the message listener at the requestor's end and using receive() method to receive back the response. and it worked. Thanks for helping me.
Cheers
Prachi
garima015 wrote
can u send the code u have written for Consumer and producer. Because i just have implemented the same thing and is working fine.May be i can help u.

Prachi Munjal wrote
Hi, Actually we have to use Active Mq and no other wrapper implementation. It will be great if you couls help me working with this. I am setting the acknowledgement mode for the session and also doing setReplyTo().
Cheers
Prachi

James.Strachan wrote
Sounds like you are not using either auto-acknowledgement, message
acknowledgement or transactions.

Until you are a bit more comfortable with the JMS API you might wanna
try Lingo which hides the JMS API from you behind a simple POJO API

http://lingo.codehaus.org/

On 12/12/06, Prachi Munjal <prachi_munjal@agilent.com> wrote:
>
> Hi, I have started using Active mq just few days back. what i am trying to
> make is a request response program in Java using Active Mq.
> Both Producer and consumer implements a message listener and my producer
> sends a message on a queue which is received by the consumer, Producer also
> creates a temporary queue and sets setJMSReplyTo property of the message
> before sending it. Consumer then creates a response and send it back to
> producer (on the temporary queue set by the producer) but producer does not
> receive it.
>
> Also when i re-start the consumer again without stopping the activemq the
> consumer receives the same msgs again that were sent to it in the previous
> run. I have set durability and persistence as False. Please suggest me a
> solution for these 2 problems.
>
> Thanks in advance.
> --
> View this message in context: http://www.nabble.com/Request-Response-tf2808416.html#a7836102
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/