Is the producer your last non-daemon thread?  If so, the JVM will exit when
that thread exits, but you could use a synchronization construct such as a
countdown latch or a call to Thread.join() to make the producer thread not
exit till the consumer does.
On Sep 28, 2015 7:21 PM, "mfan" <chaome...@gmail.com> wrote:

> I am trying to write an application that a producer (with PERSISTENT
> delivery
> mode) sends 80000 messages to asynchronous a consumer. Both producer and
> consumer are in acknowledgement mode (AUTO_ACKNOWLEDGE).  After the
> consumer
> received a message, it will do some work.  Somehow the producer producing
> message faster than consumer did the work, and right after the producer
> finished sending it's last message, both consumer called destructor
> automatically.  How to let the consumer continuously getting the message
> and
> do the computation ?  I search online and found maybe due to the
> memoryLimit. So I check the activemq.xml file in
> '/home/apache-activemq-5.11.1/data/' directory, I copied partial related to
> memory paragraph in below which I do not quite understand, I need help to
> make sure the memory was not the issue. If that is true, what else problem
> could be ? Thank you for helping.
>
>
> Store limit is 102400 mb (current store usage is 72 mb). The data
> directory:
> /home/apache-activemq-5.11.1/data/kahadb only has 12918 mb of usable space
> -
> resetting to maximum available disk space: 12990 mb |
> org.apache.activemq.broker.BrokerService | main
> 2015-09-28 17:25:08,460 | WARN  | Temporary Store limit is 51200 mb, whilst
> the temporary data directory:
> /home/apache-activemq-5.11.1/data/localhost/tmp_storage only has 12918 mb
> of
> usable space - resetting to maximum available 12918 mb. |
> org.apache.activemq.broker.BrokerService | main
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/The-consumer-thread-closed-right-after-producer-thread-finishes-sending-messages-tp4702393.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Reply via email to