You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by darkrwe <em...@gmail.com> on 2013/10/05 19:05:41 UTC

Pending Message ?

Hello guys !

I'm using activeMQ cms c++ libraries and ActiveMQ 5.8.0 as a broker.

Summary of what i'm doing is:
I have created an connection in main process in my project.
I passed the this connection to a thread and also created a fork process
from this thread.
But in this child process when i just send a message to a queue. These
messages are listed on pending message list.
I could not consume any messages that sent from these child process.

is there anyone that knows why these messages are in pending message list in
broker?
and i cannot consume?



--
View this message in context: http://activemq.2283324.n4.nabble.com/Pending-Message-tp4672302.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Pending Message ?

Posted by darkrwe <em...@gmail.com>.
I think the problem is about *forking* and all address space of parent
process copied to fork process:

But the interesting thing is that i just send the pointer of my connection
and session to thread and this child process just used main process's
connection and session and its consumer/producers..

you are right 1 message is enqueued in the queue. the rest are in pending
list...

Anyway after this problem i research the problem a little bit more. I
realize that if you use a thread with ActiveMQ you should open a new session
for each thread.

I tried this i just send the connection pointer to thread and open a new
session and create a new consumer form it.
result: It is working with no problem.

Besides:
I also tried vfork function instead of fork in my thread .
result: it is working too.
But as you know the difference between fork and vfork functions. (i dont
want to use vfork it is dangerous)

yeap here it is all my experience with usage of activeMQ.
Maybe someone could explain the situation in details..



--
View this message in context: http://activemq.2283324.n4.nabble.com/Pending-Message-tp4672302p4672307.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Pending Message ?

Posted by stargate <er...@kabelbw.de>.
Hi,

i can not help you, but i have exact the same problem with ActiveMQ and
Java. But not all messages are pending.. if i send of course 40 message`s
then 30 are delivered and 8 are pending, and i don`t know why they are
pending und how i can tell the broker/consumer that he should deliver this
pending messages.

Best regards
stargate



--
View this message in context: http://activemq.2283324.n4.nabble.com/Pending-Message-tp4672302p4672303.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.