Awesome. Thanks, Tim.
Steve Rice
--
View this message in context:
http://activemq.2283324.n4.nabble.com/how-to-safely-delete-a-cms-MessageListener-object-tp4689939p4690062.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
On 01/16/2015 12:09 PM, Steve Rice wrote:
So if the thread wanting to shut down the Message Listening sets the message
listener to NULL, the setMessageListener call will not return until there is
no onMessage function in progress?
And so, after the setMessageListener(NULL) call returns, it is sa
So if the thread wanting to shut down the Message Listening sets the message
listener to NULL, the setMessageListener call will not return until there is
no onMessage function in progress?
And so, after the setMessageListener(NULL) call returns, it is safe to
delete the MessageListener object?
S
That sounds way better than what I'd proposed.
On Fri, Jan 16, 2015 at 9:18 AM, Timothy Bish wrote:
> On 01/15/2015 09:16 PM, artnaseef wrote:
>
>> How about the following instead? As Tim pointed out, the consumer close
>> won't return until no more calls to onMessage are guaranteed. I believe
On 01/15/2015 09:16 PM, artnaseef wrote:
How about the following instead? As Tim pointed out, the consumer close
won't return until no more calls to onMessage are guaranteed. I believe
that also means it won't return while onMessage() is actively being called.
@Tim - can you confirm?
It shou
How about the following instead? As Tim pointed out, the consumer close
won't return until no more calls to onMessage are guaranteed. I believe
that also means it won't return while onMessage() is actively being called.
@Tim - can you confirm?
If that's correct, the following should do the job
Thanks. I considered the sleep idea and will probably go that route.
Steve Rice
--
View this message in context:
http://activemq.2283324.n4.nabble.com/how-to-safely-delete-a-cms-MessageListener-object-tp4689939p4689997.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
You could probably handle that problem in most cases by adding a flag that
says whether onMessage() is currently running (increment on entry,
decrement on exit) combined with a long enough sleep() call; it's a bit
ham-fisted, but it should be good enough. Close the consumer (so you know
that there
Thanks for the suggestions. I have a request-and-reply mechanism, where the
reply arrives asynchronously to a temporary queue, and a consumer has been
set up to listen for that reply sent to the temporary queue. At some point,
after waiting awhile to receive the reply and still not getting it, th
On 01/14/2015 08:01 PM, Steve Rice wrote:
Since the onMessage() function runs in a separate thread, how do I safely
delete a cms::MessageListener object in the main thread using C++11? If the
reply I am looking for never comes, I want to give up on listening for it
and throw away this object. B
Good question. In java, we don't need to worry about the memory allocation -
just the concurrency. While I don't know the answer, I'll give some input
here.
Have you looked through the CMS code? Some things that may work:
* Closing the consumer; once the close() method returns, I would not exp
11 matches
Mail list logo