You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by sgliu <sh...@sina.com> on 2006/11/13 06:50:57 UTC

about durable subscription

http://www.activemq.com/site/activemq-c-clients.html
Above sample,I want finish durable subscription.I don't konw how about
modification.
I change createQueue() to createTopic(),but only archieve non-durable
subscription.
If I change main function to follow three function,I will receive nothing.
  void Produce() 
 { 
     HelloWorldProducer producer( 5 ); 
     Thread producerThread( &producer ); 
     producerThread.start(); 
     producerThread.join(); 
 } 
 void Consumer() 
 { 
      HelloWorldConsumer consumer( 3000 ); 
      Thread consumerThread( &consumer ); 
      consumerThread.start(); 
      consumerThread.join(); 
 } 
 int main(int argc, char* argv[]) 
 { 
      Produce(); 
      Consumer(); 
 }
How can I do?

Base on sample, I add code(setCMSExpiration function) for message
livetime.But receive nothing too.

SOS
-- 
View this message in context: http://www.nabble.com/about-durable-subscription-tf2620113.html#a7311797
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: about durable subscription

Posted by sgliu <sh...@sina.com>.
SOS


sgliu wrote:
> 
> As before,I receive nothing.Can you tell me what modification in Consumer
> I do else?What modification need in Producer?
> Thanks for your advice..
> 
> 
> 
> 
> James.Strachan wrote:
>> 
>> To use durable subscription use the correct createDurableSubscriber()
>> method...
>> 
>> http://incubator.apache.org/activemq/cms/html/classcms_1_1Session.html#eb5c8b32a4422e467a6929d96e8763cb
>> 
>> On 11/13/06, sgliu <sh...@sina.com> wrote:
>>>
>>> http://www.activemq.com/site/activemq-c-clients.html
>>> Above sample,I want finish durable subscription.I don't konw how about
>>> modification.
>>> I change createQueue() to createTopic(),but only archieve non-durable
>>> subscription.
>>> If I change main function to follow three function,I will receive
>>> nothing.
>>>   void Produce()
>>>  {
>>>      HelloWorldProducer producer( 5 );
>>>      Thread producerThread( &producer );
>>>      producerThread.start();
>>>      producerThread.join();
>>>  }
>>>  void Consumer()
>>>  {
>>>       HelloWorldConsumer consumer( 3000 );
>>>       Thread consumerThread( &consumer );
>>>       consumerThread.start();
>>>       consumerThread.join();
>>>  }
>>>  int main(int argc, char* argv[])
>>>  {
>>>       Produce();
>>>       Consumer();
>>>  }
>>> How can I do?
>>>
>>> Base on sample, I add code(setCMSExpiration function) for message
>>> livetime.But receive nothing too.
>>>
>>> SOS
>>> --
>>> View this message in context:
>>> http://www.nabble.com/about-durable-subscription-tf2620113.html#a7311797
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> -- 
>> 
>> James
>> -------
>> http://radio.weblogs.com/0112098/
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/about-durable-subscription-tf2620113.html#a7333429
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: about durable subscription

Posted by sgliu <sh...@sina.com>.
As before,I receive nothing.Can you tell me what modification in Consumer I
do else?What modification need in Producer?
Thanks for your advice..




James.Strachan wrote:
> 
> To use durable subscription use the correct createDurableSubscriber()
> method...
> 
> http://incubator.apache.org/activemq/cms/html/classcms_1_1Session.html#eb5c8b32a4422e467a6929d96e8763cb
> 
> On 11/13/06, sgliu <sh...@sina.com> wrote:
>>
>> http://www.activemq.com/site/activemq-c-clients.html
>> Above sample,I want finish durable subscription.I don't konw how about
>> modification.
>> I change createQueue() to createTopic(),but only archieve non-durable
>> subscription.
>> If I change main function to follow three function,I will receive
>> nothing.
>>   void Produce()
>>  {
>>      HelloWorldProducer producer( 5 );
>>      Thread producerThread( &producer );
>>      producerThread.start();
>>      producerThread.join();
>>  }
>>  void Consumer()
>>  {
>>       HelloWorldConsumer consumer( 3000 );
>>       Thread consumerThread( &consumer );
>>       consumerThread.start();
>>       consumerThread.join();
>>  }
>>  int main(int argc, char* argv[])
>>  {
>>       Produce();
>>       Consumer();
>>  }
>> How can I do?
>>
>> Base on sample, I add code(setCMSExpiration function) for message
>> livetime.But receive nothing too.
>>
>> SOS
>> --
>> View this message in context:
>> http://www.nabble.com/about-durable-subscription-tf2620113.html#a7311797
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/about-durable-subscription-tf2620113.html#a7329636
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: about durable subscription

Posted by James Strachan <ja...@gmail.com>.
To use durable subscription use the correct createDurableSubscriber() method...

http://incubator.apache.org/activemq/cms/html/classcms_1_1Session.html#eb5c8b32a4422e467a6929d96e8763cb

On 11/13/06, sgliu <sh...@sina.com> wrote:
>
> http://www.activemq.com/site/activemq-c-clients.html
> Above sample,I want finish durable subscription.I don't konw how about
> modification.
> I change createQueue() to createTopic(),but only archieve non-durable
> subscription.
> If I change main function to follow three function,I will receive nothing.
>   void Produce()
>  {
>      HelloWorldProducer producer( 5 );
>      Thread producerThread( &producer );
>      producerThread.start();
>      producerThread.join();
>  }
>  void Consumer()
>  {
>       HelloWorldConsumer consumer( 3000 );
>       Thread consumerThread( &consumer );
>       consumerThread.start();
>       consumerThread.join();
>  }
>  int main(int argc, char* argv[])
>  {
>       Produce();
>       Consumer();
>  }
> How can I do?
>
> Base on sample, I add code(setCMSExpiration function) for message
> livetime.But receive nothing too.
>
> SOS
> --
> View this message in context: http://www.nabble.com/about-durable-subscription-tf2620113.html#a7311797
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/