You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by ssahu <so...@wipro.com> on 2013/07/30 13:59:24 UTC

Re: How to expire or set time to live for topic messages?

As MessageProducer is an Interface having method setTimeToLive(long
timeToLive).

So which class is providing implementation for this method?

How can i call this method in my program,as it is giving compilation error
for this method not found.
I have imported javax.jms.MessageProducer in my java program ,and there is
no error shown in import statement. 

Thanks,
Sonal



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-expire-or-set-time-to-live-for-topic-messages-tp4667952p4669867.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to expire or set time to live for topic messages?

Posted by Christian Posta <ch...@gmail.com>.
Yes, session#createProducer gives the impl for MessageProducer interface.

You should use the method I mentioned earlier in the thread to set the TTL.




On Wed, Jul 31, 2013 at 3:58 AM, ssahu <so...@wipro.com> wrote:

> When i do session.createProducer(..) ,will it automatically create the
> implementation for MessageProducer ??
>
> Then will i be able to call messageProducer.setTimeTOLive(2000); ???
>
> How can i be able to call messageProducer.setTimeTOLive(2000);  as it is
> giving compilation error on this line???
>
> I imported javax.jms.MessageProducer class .NO error for it.
> I did messageProducer=session.createProducer(..) after that but still i am
> not able to call messageProducer.setTimeToLive(2000);.It is giving
> compilation error.
>
>
> Thanks And Regards,
> Sonal
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/How-to-expire-or-set-time-to-live-for-topic-messages-tp4667952p4669907.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: How to expire or set time to live for topic messages?

Posted by ssahu <so...@wipro.com>.
When i do session.createProducer(..) ,will it automatically create the
implementation for MessageProducer ??

Then will i be able to call messageProducer.setTimeTOLive(2000); ???

How can i be able to call messageProducer.setTimeTOLive(2000);  as it is
giving compilation error on this line???

I imported javax.jms.MessageProducer class .NO error for it.
I did messageProducer=session.createProducer(..) after that but still i am
not able to call messageProducer.setTimeToLive(2000);.It is giving
compilation error.


Thanks And Regards,
Sonal



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-expire-or-set-time-to-live-for-topic-messages-tp4667952p4669907.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to expire or set time to live for topic messages?

Posted by Christian Posta <ch...@gmail.com>.
Yes, it's an interface.

when you have an activemq session, you can do

session.createProducer(...) to create the impl of the MessageProducer
interface.


On Tue, Jul 30, 2013 at 4:59 AM, ssahu <so...@wipro.com> wrote:

> As MessageProducer is an Interface having method setTimeToLive(long
> timeToLive).
>
> So which class is providing implementation for this method?
>
> How can i call this method in my program,as it is giving compilation error
> for this method not found.
> I have imported javax.jms.MessageProducer in my java program ,and there is
> no error shown in import statement.
>
> Thanks,
> Sonal
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/How-to-expire-or-set-time-to-live-for-topic-messages-tp4667952p4669867.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta