[ 
https://issues.apache.org/activemq/browse/AMQNET-133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jim Gomes resolved AMQNET-133.
------------------------------

    Resolution: Fixed

Marking this item as Fixed, as I believe it was a Spring.NET issue, and it has 
been resolved in that library.  Please reopen if this is not the case.

> Consumers cannot be stopped without causing error for messages that are 
> already in process
> ------------------------------------------------------------------------------------------
>
>                 Key: AMQNET-133
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-133
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>    Affects Versions: 1.2
>         Environment: ActiveMQ message Consumers
>            Reporter: NNZZ
>            Assignee: Jim Gomes
>
> I do not see any way to stop listeners from accepting new messages BUT let 
> them finish processing messages that are already in process (like drain stop 
> in IIS). And also a way to start them back so new messages will be processed 
> as normal AND also pending messages, that were sent while the listeners were 
> 'blocked', will be processed as well.
> I am using spring.Net and when I tried 
> Spring.Context.Support.ContextRegistry.Clear() and 
> SimpleMessageListenerContainer.Stop() but both methods caused failure for 
> messages that were already in process by the consumers (Thread aborted 
> method) - It seems like those methods just stopped the consumer completely. 
> Since I could not  find anything that worked, I also tried changing the 
> message selector directly on the consumers (using JMX) to a false expression 
> (like 1>1) , and that did stop any new messages without interfering the 
> processing of existing ones, but I couldn't then 'turn the consumers back 
> on'. When I changed the selector to a true expression (like 1=1), I could not 
> resend the pending messages, that where sent while the selector was false. I 
> tried to resend them by getting the pending messages Ids (which I got from 
> JVM) and then invoke the retryMessage message of 
> org.apache.activemq.broker.region.Queue (got that object from JVM\JMx as 
> well). However when I did so I got the following error:
> javax.jms.JMSException: No original destination for message: 
> 05d79c66-be01-4db1-adc6-73384475a6f9:1:1:1
> Would you be able to advise whether there a way to stop listeners without 
> aborting the thread and then start them again so that pending messages will 
> be consumed? and if not would that be possible to add such functionality? It 
> is required when updating our service (the exe files) that is using ActiveMQ.
> Many thanks
> N

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to