You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Nydia <Da...@yahoo.com.cn> on 2007/07/19 05:04:35 UTC

question about c++ client(DeliveryMode::PERSISTENT )

I sent the topic message using persistent:
  destination = session->createTopic( "TEST.FOO" );
  producer = session->createProducer( destination );
  producer->setDeliveryMode( DeliveryMode::PERSISTENT );
......
 producer->send( message );

and recived the message with the codes:
destination = session->createTopic( "TEST.FOO" );
consumer = session->createDurableConsumer(
(Topic*)destination,"testConsumer", "");
 consumer->setMessageListener( this );

but I recived nothing! I think the sending has no problem,becouse I sent the
message with c++ code(just like upsite),reviced with java client
successed!So I think there must be some problems happened in my recive
codes,Is there anyone could help me?thanks.
-- 
View this message in context: http://www.nabble.com/question-about-c%2B%2B-client%28DeliveryMode%3A%3APERSISTENT-%29-tf4107862s2354.html#a11681566
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: question about c++ client(DeliveryMode::PERSISTENT )

Posted by Nydia <Da...@yahoo.com.cn>.


nmittler wrote:
> 
> If you want your consumer (even a durable one) to receive the messages, it
> would have to have been registered on the topic before the message was
> sent.  At that point, you could kill your consumer and bring it back up
> and
> it will get the messages it missed.
> 
> The way you have your application setup, what you'd need is a retroactive
> consumer (http://activemq.apache.org/retroactive-consumer.html).  This
> will
> allow your consumer to receive messages that were sent before it came
> online.
> 
I guess I know your mean ,maybe it is so different to java-activemq.I had
used the java-activemq,it let me to run the consumer after sending in the
state of persistent.I had try the retroactive consumer ,but it couldn't
recive all the messages,only some of them.
-- 
View this message in context: http://www.nabble.com/question-about-c%2B%2B-client%28DeliveryMode%3A%3APERSISTENT-%29-tf4107862s2354.html#a11736553
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: question about c++ client(DeliveryMode::PERSISTENT )

Posted by Nathan Mittler <na...@gmail.com>.
If you want your consumer (even a durable one) to receive the messages, it
would have to have been registered on the topic before the message was
sent.  At that point, you could kill your consumer and bring it back up and
it will get the messages it missed.

The way you have your application setup, what you'd need is a retroactive
consumer (http://activemq.apache.org/retroactive-consumer.html).  This will
allow your consumer to receive messages that were sent before it came
online.

Nate

On 7/19/07, Nydia <Da...@yahoo.com.cn> wrote:
>
>
>
> nmittler wrote:
> >
> > Is it possible that you're sending the message before you've created the
> > consumer?
> >
> >
> yes ,first I run the producer,after finishing the sending,I run the
> consumer
> to recive the message.because,I thought,the message is persistent,and the
> consumer is DurableConsumer ,I could recive anytime.am I right?
> --
> View this message in context:
> http://www.nabble.com/question-about-c%2B%2B-client%28DeliveryMode%3A%3APERSISTENT-%29-tf4107862s2354.html#a11700928
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>

Re: question about c++ client(DeliveryMode::PERSISTENT )

Posted by Nydia <Da...@yahoo.com.cn>.

nmittler wrote:
> 
> Is it possible that you're sending the message before you've created the
> consumer?
> 
> 
yes ,first I run the producer,after finishing the sending,I run the consumer
to recive the message.because,I thought,the message is persistent,and the
consumer is DurableConsumer ,I could recive anytime.am I right?
-- 
View this message in context: http://www.nabble.com/question-about-c%2B%2B-client%28DeliveryMode%3A%3APERSISTENT-%29-tf4107862s2354.html#a11700928
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: question about c++ client(DeliveryMode::PERSISTENT )

Posted by Nathan Mittler <na...@gmail.com>.
Is it possible that you're sending the message before you've created the
consumer?

On 7/18/07, Nydia <Da...@yahoo.com.cn> wrote:
>
>
> I sent the topic message using persistent:
>   destination = session->createTopic( "TEST.FOO" );
>   producer = session->createProducer( destination );
>   producer->setDeliveryMode( DeliveryMode::PERSISTENT );
> ......
> producer->send( message );
>
> and recived the message with the codes:
> destination = session->createTopic( "TEST.FOO" );
> consumer = session->createDurableConsumer(
> (Topic*)destination,"testConsumer", "");
> consumer->setMessageListener( this );
>
> but I recived nothing! I think the sending has no problem,becouse I sent
> the
> message with c++ code(just like upsite),reviced with java client
> successed!So I think there must be some problems happened in my recive
> codes,Is there anyone could help me?thanks.
> --
> View this message in context:
> http://www.nabble.com/question-about-c%2B%2B-client%28DeliveryMode%3A%3APERSISTENT-%29-tf4107862s2354.html#a11681566
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>