You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by JackOfAllTrades <Ha...@yahoo.com> on 2015/10/29 15:21:19 UTC

AMQ CPP Consumer Receive() and receiveNoWait() does not return

I'm trying to update to AMQ CPP 3.9.0.

The calls to the consumer receive() and receiveNoWait() will not return. 
There are messages available on the queue.  Older version 2.4.4 worked.

Anybody have any thoughts on this?

Thanks!
Steve



--
View this message in context: http://activemq.2283324.n4.nabble.com/AMQ-CPP-Consumer-Receive-and-receiveNoWait-does-not-return-tp4703485.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: AMQ CPP Consumer Receive() and receiveNoWait() does not return

Posted by JackOfAllTrades <Ha...@yahoo.com>.
Ok, two years later and I am trying to update again, but still have the same
problem.  Is there anybody out there that has any insight to why the receive
methods to do return?

What else do I need to post here to get a handle on this?



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: AMQ CPP Consumer Receive() and receiveNoWait() does not return

Posted by JackOfAllTrades <Ha...@yahoo.com>.
Does anybody have any insight on this?

The first call to receive apparently works or returns.  The subsequent call
to receive() never returns even with messages waiting or with a timeout set
receive(1000) 

Any help would be very much appreciated.

Thanks!



--
View this message in context: http://activemq.2283324.n4.nabble.com/AMQ-CPP-Consumer-Receive-and-receiveNoWait-does-not-return-tp4703485p4711339.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: AMQ CPP Consumer Receive() and receiveNoWait() does not return

Posted by JackOfAllTrades <Ha...@yahoo.com>.
Where or how does one set the prefetch policy for each connection?  




--
View this message in context: http://activemq.2283324.n4.nabble.com/AMQ-CPP-Consumer-Receive-and-receiveNoWait-does-not-return-tp4703485p4703668.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: AMQ CPP Consumer Receive() and receiveNoWait() does not return

Posted by spamtrap <no...@spamgourmet.com>.
On Tue, 3 Nov 2015 11:08:29 -0800 (PST), JackOfAllTrades
<Ha...@yahoo.com> wrote:

>All I can do at the moment....
>
>
>
>auto_ptr<ActiveMQConectionFactory> factory( new ActiveMQConectionFactory
>(MY_BROKER_URL));
>
>cms::Connection* conxn=null;
>conxn=factory->CreatConnection();
>
>auto_ptr<ActiveMQConection> myConn(dynamic_cast<ActiveMQConection*>(conxn));
>
>myConn->start();
>
>auto_ptr<Session> mySession;
>mySession.reset(myConn->CreateSession(Session::AUTO_ACKNOWLEDGE));
>
>auto_ptr<Destination> myDest;
>myDest.reset(mySession->CreateQueue(MY_QUEUE_URI));
>
>auto_ptr<Consumer> myConsumer;
>myConsumer.reset(MySession->createConsumer(MyDest.get()));
>
>myConsumer->receive(1000);
>or
>myConsumer->receiveNoWait();
>
>This all worked just fine under 2.4.4.
>all calls to receive now hang.....they just don't return.

The only thing I can see is that I would use the static member
function of the connection factory to create it.  I don't have much
time now but I may look into this later.



Re: AMQ CPP Consumer Receive() and receiveNoWait() does not return

Posted by JackOfAllTrades <Ha...@yahoo.com>.
All I can do at the moment....



auto_ptr<ActiveMQConectionFactory> factory( new ActiveMQConectionFactory
(MY_BROKER_URL));

cms::Connection* conxn=null;
conxn=factory->CreatConnection();

auto_ptr<ActiveMQConection> myConn(dynamic_cast<ActiveMQConection*>(conxn));

myConn->start();

auto_ptr<Session> mySession;
mySession.reset(myConn->CreateSession(Session::AUTO_ACKNOWLEDGE));

auto_ptr<Destination> myDest;
myDest.reset(mySession->CreateQueue(MY_QUEUE_URI));

auto_ptr<Consumer> myConsumer;
myConsumer.reset(MySession->createConsumer(MyDest.get()));

myConsumer->receive(1000);
or
myConsumer->receiveNoWait();

This all worked just fine under 2.4.4.
all calls to receive now hang.....they just don't return.

auto_ptr<Queue_Connector> myConsumer;




--
View this message in context: http://activemq.2283324.n4.nabble.com/AMQ-CPP-Consumer-Receive-and-receiveNoWait-does-not-return-tp4703485p4703642.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: AMQ CPP Consumer Receive() and receiveNoWait() does not return

Posted by spamtrap <no...@spamgourmet.com>.
On Thu, 29 Oct 2015 07:21:19 -0700 (PDT), JackOfAllTrades
<Ha...@yahoo.com> wrote:

>I'm trying to update to AMQ CPP 3.9.0.
>
>The calls to the consumer receive() and receiveNoWait() will not return. 
>There are messages available on the queue.  Older version 2.4.4 worked.
>
>Anybody have any thoughts on this?

Can you post a small/simple program that exhibits this problem?

BTW: I always use asynchronous delivery.