You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by aness123 <an...@spam.la> on 2010/03/03 09:29:58 UTC
ActiveMQ / JMS jam when message producer sends messages
Hi @ all,
I'm using ActiveMQ 5.3.0 and Java Message Service to send and receive
message to/from several queues. I wanna send 1000 messages and more by my
program by using a MessageProducer. Unfortunately sending jams when I send
more than 300 messages. My program does not continue anymore. Here is some
code:
Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
final Queue queue = session.createQueue(queueNamePrefix +
doc.getRootElement().getName());
final MessageProducer producer = session.createProducer(queue);
final TextMessage msg = session.createTextMessage(out.outputString(doc));
producer.send(msg); //--> program jams here
Does anyone have an idea? Thank you
Aness
--
View this message in context: http://old.nabble.com/ActiveMQ---JMS-jam-when-message-producer-sends-messages-tp27765481p27765481.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: ActiveMQ / JMS jam when message producer sends messages
Posted by Márcio Geovani Jasinski <ma...@gmail.com>.
Hi Aneess
I could not find any issue in your code. Are you sure that your program is
not sending only 300 messages or exiting by timeout?
This issue happens even with something like that?
while(true) {
producer.send(msg);
}
I suggest you to check the sample from ActiveMQ - from
your installation folder example/src/ProducerTool.java
--
Márcio Geovani Jasinski
Re: ActiveMQ / JMS jam when message producer sends messages
Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Mar 3, 2010 at 1:29 AM, aness123 <an...@spam.la> wrote:
>
> Hi @ all,
>
> I'm using ActiveMQ 5.3.0 and Java Message Service to send and receive
> message to/from several queues. I wanna send 1000 messages and more by my
> program by using a MessageProducer. Unfortunately sending jams when I send
> more than 300 messages. My program does not continue anymore. Here is some
> code:
>
> Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
> final Queue queue = session.createQueue(queueNamePrefix +
> doc.getRootElement().getName());
> final MessageProducer producer = session.createProducer(queue);
> final TextMessage msg = session.createTextMessage(out.outputString(doc));
> producer.send(msg); //--> program jams here
>
> Does anyone have an idea? Thank you
Sounds like you are running into producer flow control:
http://activemq.apache.org/producer-flow-control.html
You can disable this using destination policies.
Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder
Re: ActiveMQ / JMS jam when message producer sends messages
Posted by Tracy Snell <ts...@gmail.com>.
On Mar 3, 2010, at 3:29 AM, aness123 wrote:
>
> I'm using ActiveMQ 5.3.0 and Java Message Service to send and receive
> message to/from several queues. I wanna send 1000 messages and more by my
> program by using a MessageProducer. Unfortunately sending jams when I send
> more than 300 messages. My program does not continue anymore. Here is some
> code:
Are there any errors in the broker logs? What do your broker config look like? Are you keeping one connection and sending using it or getting a new one each time?