You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Rakesh Kumar <ra...@yahoo.co.in> on 2008/07/10 06:52:02 UTC

Fw: ActiveMQ message consumer not closing...

Hi All,
I could not here anything about this issue that i am facing. can anyone help me out here.

Regards,
Rakesh
----- Forwarded Message ----
From: Rakesh Kumar <ra...@yahoo.co.in>
To: dev@activemq.apache.org
Sent: Wednesday, 9 July, 2008 2:21:51 PM
Subject: ActiveMQ message consumer not closing...


Hi All,
 
I have a created the connection and consumers using ActiveMQ, and consumer is waiting for the recive to complete. when we shutdown the application we close the connection, but close call of connection does not notify all the consumers (who is waiting for the message to be recived) after purging all the messages which is causing our application not to shutdown.
we modified the close call the notify all the consumers after purging all the unconsumed mesages and so 

Following is the changes that i have made in ActiveMQConsumer.cpp class (code block in blue)
void ActiveMQConsumer::close(){
....
            // Purge all the pending messages
            try{
                purgeMessages();
            } catch ( ActiveMQException& ex ){
                if( !haveException ){
                    ex.setMark( __FILE__, __LINE__ );
                    error = ex;
                    haveException = true;
                }
            }

         synchronized( &unconsumedMessages )
         {
                unconsumedMessages.notifyAll();
         }
...
}

can anyone let me know why this has not been done?
 
Thanks for the reply in advance...
 
Regards,
Rakesh
consumer->receive() call is able to come out of the wait and shutdown of application happens properly


      Explore your hobbies and interests. Go to http://in.promos.yahoo.com/groups/

Re: ActiveMQ message consumer not closing...

Posted by Rob Davies <ra...@gmail.com>.
Hi Rakesh,

The best thing to do is to create an issue (we tend to call them  
jiras) - see here: http://issues.apache.org/activemq/browse/AMQ
attach your code to the instance as a patch - then let the community  
know you've done this - and flag it as the c++ client.
The reason for doing this is that there is a lot of traffic comes in  
on the mailing lists - its easy to miss them - but at least they can  
be tracked in jira and there's only a couple (at most) active folks  
doing the non-java stuff in the community

cheers,

Rob

On 10 Jul 2008, at 05:52, Rakesh Kumar wrote:

> Hi All,
> I could not here anything about this issue that i am facing. can  
> anyone help me out here.
>
> Regards,
> Rakesh
> ----- Forwarded Message ----
> From: Rakesh Kumar <ra...@yahoo.co.in>
> To: dev@activemq.apache.org
> Sent: Wednesday, 9 July, 2008 2:21:51 PM
> Subject: ActiveMQ message consumer not closing...
>
>
> Hi All,
>
> I have a created the connection and consumers using ActiveMQ, and  
> consumer is waiting for the recive to complete. when we shutdown the  
> application we close the connection, but close call of connection  
> does not notify all the consumers (who is waiting for the message to  
> be recived) after purging all the messages which is causing our  
> application not to shutdown.
> we modified the close call the notify all the consumers after  
> purging all the unconsumed mesages and so
>
> Following is the changes that i have made in ActiveMQConsumer.cpp  
> class (code block in blue)
> void ActiveMQConsumer::close(){
> ....
>             // Purge all the pending messages
>             try{
>                 purgeMessages();
>             } catch ( ActiveMQException& ex ){
>                 if( !haveException ){
>                     ex.setMark( __FILE__, __LINE__ );
>                     error = ex;
>                     haveException = true;
>                 }
>             }
>
>          synchronized( &unconsumedMessages )
>          {
>                 unconsumedMessages.notifyAll();
>          }
> ...
> }
>
> can anyone let me know why this has not been done?
>
> Thanks for the reply in advance...
>
> Regards,
> Rakesh
> consumer->receive() call is able to come out of the wait and  
> shutdown of application happens properly
>
>
>      Explore your hobbies and interests. Go to http://in.promos.yahoo.com/groups/