You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by seven_ephors <ch...@aero.org> on 2008/05/01 22:16:57 UTC

Publisher can't publish after a certain number of messages are sent

I am using the TopicPublisher.java code in the 5.0.0\example\src directory,
with slight modifications.  It seem to work pretty well, but when I have
large number of messages, it always stop working after certain number of
messages are published.  For a BytesMessage with data size of 256X128, I can
only send up to 743 message.  After that, the publisher can't send any more
message to the broker.  In order to get it to work again, I need to ctrl-C
on the ActiveMQ DOS window, and restart the broker.  Since I need to publish
topic continuously, I need to find solution to the problem.

My questions are, 1, anyone have similar problem with a publisher?  2, What
am I doing wrong?  3, What solution is there?
-- 
View this message in context: http://www.nabble.com/Publisher-can%27t-publish-after-a-certain-number-of-messages-are-sent-tp16995039s2354p16995039.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Publisher can't publish after a certain number of messages are sent

Posted by Rob Davies <ra...@gmail.com>.
On 2 May 2008, at 19:48, seven_ephors wrote:

>
> What is the typical message size when BLOB message should be used?
> --  
> View this message in context: http://www.nabble.com/Publisher-can%27t-publish-after-a-certain-number-of-messages-are-sent-tp16995039s2354p17025624.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
When the message size is more than 1 or 2 mb usually - but it is very  
application and system dependent.

cheers,

Rob

http://open.iona.com/ -Enterprise Open Integration
http://rajdavies.blogspot.com/




Re: Publisher can't publish after a certain number of messages are sent

Posted by seven_ephors <ch...@aero.org>.
What is the typical message size when BLOB message should be used?
-- 
View this message in context: http://www.nabble.com/Publisher-can%27t-publish-after-a-certain-number-of-messages-are-sent-tp16995039s2354p17025624.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Publisher can't publish after a certain number of messages are sent

Posted by Bruce Snyder <br...@gmail.com>.
On Fri, May 2, 2008 at 10:50 AM, seven_ephors <ch...@aero.org> wrote:
>
>  I will give it a try later, but it seems to me that it probably won't solve
>  the problem since the consumer fetches the message as soon as it is
>  published, and when I increase the message size, the number of message that
>  can be send decrease accordingly.  For example, when the BytesMessage has
>  the payload doubled, the number of BytesMessages that were send almost
>  halved (but not exactly).

Well besides what I described for the configuring prefetch on the
client side, the broker side can be configured as well. By default,
ActiveMQ will start to slow down producers when memory limits are
being reached, as described here:

http://activemq.apache.org/my-producer-blocks.html

ActiveMQ limits itself to consuming 20mb of memory by default, not
much if you're dealing with large messages or large amounts of
messages. You should probably consider increasing this to more
appropriately address your situation. This can be achieved in the
activemq.xml configuration file using the memoryUsage element. See the
default activemq.xml for some examples.

Also bear in mind that this has a direct impact on the JVM memory, so
you may need to tune that as well.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Re: Publisher can't publish after a certain number of messages are sent

Posted by seven_ephors <ch...@aero.org>.
I will give it a try later, but it seems to me that it probably won't solve
the problem since the consumer fetches the message as soon as it is
published, and when I increase the message size, the number of message that
can be send decrease accordingly.  For example, when the BytesMessage has
the payload doubled, the number of BytesMessages that were send almost
halved (but not exactly).


bsnyder wrote:
> 
> Most typically this is an issue with the consumer side processing
> being much slower than the broker side, so the messages back up on the
> broker. One solution to such slow consumer situations is to use the
> consumer prefetch prefetch policy. See the following for more info:
> 
> http://activemq.apache.org/what-is-the-prefetch-limit-for.html
> 
> Please read through that and see if it describes your situation and if
> it does, give the prefetch policy a try.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache ActiveMQ - http://activemq.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
> Apache Geronimo - http://geronimo.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/Publisher-can%27t-publish-after-a-certain-number-of-messages-are-sent-tp16995039s2354p17023458.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Publisher can't publish after a certain number of messages are sent

Posted by Bruce Snyder <br...@gmail.com>.
On Thu, May 1, 2008 at 2:16 PM, seven_ephors <ch...@aero.org> wrote:
>
>  I am using the TopicPublisher.java code in the 5.0.0\example\src directory,
>  with slight modifications.  It seem to work pretty well, but when I have
>  large number of messages, it always stop working after certain number of
>  messages are published.  For a BytesMessage with data size of 256X128, I can
>  only send up to 743 message.  After that, the publisher can't send any more
>  message to the broker.  In order to get it to work again, I need to ctrl-C
>  on the ActiveMQ DOS window, and restart the broker.  Since I need to publish
>  topic continuously, I need to find solution to the problem.
>
>  My questions are, 1, anyone have similar problem with a publisher?  2, What
>  am I doing wrong?  3, What solution is there?

Most typically this is an issue with the consumer side processing
being much slower than the broker side, so the messages back up on the
broker. One solution to such slow consumer situations is to use the
consumer prefetch prefetch policy. See the following for more info:

http://activemq.apache.org/what-is-the-prefetch-limit-for.html

Please read through that and see if it describes your situation and if
it does, give the prefetch policy a try.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/