activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Stanton (JIRA)" <>
Subject [jira] Commented: (AMQ-721) Openwire client hangs after receiving 999 messages
Date Mon, 19 Jun 2006 20:57:51 GMT
    [ ] 

James Stanton commented on AMQ-721:

I also had the same problem, but I was able to put together a hack that gets around this problem.
 I don't recommend this as the solution going forward, but it appears to work on my test cases
(which failed before I implemented it).  

First we need to change the dotNet dll client classes.
in class IMessageConsumer, add a new function:

IMessage AutoAcknowledge(IMessage message);

in class MessageConsumer, make AutoAcknowledge public rather then protected.

Then, create your dll.

Now, in your test app do the following:

Let's assume you've created a consumer called "consumer" and have defined the following:
consumer.Listener += new MessageListener(onMessage);

set up the listener function as follows:
public void onMessage(IMessage message)
     If (consumer != null) //just a good idea to check
     // whatever you want to do with your message goes here... I've just put a Console.WriteLine
here, but do whatever you want here
    Console.WriteLine("got Message:  " + ((ActiveMQTextMessage)message).Text);

This isn't an ideal solution, because it requires the MessageListener to call AutoAcknowledge,
but it seems to work.  I hope this helps folks who are trying to do this!


> Openwire client hangs after receiving 999 messages
> --------------------------------------------------
>          Key: AMQ-721
>          URL:
>      Project: ActiveMQ
>         Type: Bug

>   Components: JMS client
>     Versions: 4.0
>  Environment: .NET 2.0 ,C# + trunk
>     Reporter: vincent boilay
>     Priority: Blocker

> Openwire client hangs after receiving 999 messages
> changing Session.Prefetch postpone the  problem...
> Current code is :
>    public class Session : ISession
>     {
>        :
>        :
>         private int prefetchSize = 1000;
> this block at message #999
> changing         private int prefetchSize = 2000 ==>  blocks at message #1999

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message