You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by rmadden <ma...@gmail.com> on 2011/05/23 22:56:24 UTC

Scheduler Broken?

I have tried both 5.4.2 and 5.5 and have been unable to get the scheduler to
work.  I have set
schedulerSupport=true in the activemq-specjms.xml file.

My code looks as follows:

public void scheduleMessage() throws JMSException {
	Destination destination = new ActiveMQQueue("OutboxTwitterUpdateStatus");		
	String json = TwitterPojoFactory.make().asJson();

	session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
	MessageProducer producer = session.createProducer(destination);
        TextMessage message = session.createTextMessage(json);
        
        // Cron: # m h dom mon dow
        message.setStringProperty(ScheduledMessage.AMQ_SCHEDULED_ID, "0");
        message.setStringProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY,
"60000");
       
System.out.println(message.getStringProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY));
        producer.send(message);
}

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

Re: Scheduler Broken?

Posted by Dejan Bosanac <de...@nighttale.net>.
Create a test case that reproduces the problem. Take a look at
JmsSchedulerTest for an example

https://fisheye6.atlassian.com/browse/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/scheduler/JmsSchedulerTest.java?hb=true

<https://fisheye6.atlassian.com/browse/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/scheduler/JmsSchedulerTest.java?hb=true>
Regards
-- 
Dejan Bosanac - http://twitter.com/dejanb
-----------------
The experts in open source integration and messaging - http://fusesource.com
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net

Connect at CamelOne <http://camelone.com/> May 24-26

The Open Source Integration Conference



On Tue, May 24, 2011 at 8:16 PM, rmadden <ma...@gmail.com> wrote:

> Dejan, thanks for the response.
>
> I removed the line, but I am still seeing the message de-queued
> immediately.
> On the server side, I have set the schedulerSupport="true" in my
> conf/acticemq-specjms.xml file, not sure what else to do ...
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Scheduler-Broken-tp3545460p3547813.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: Scheduler Broken?

Posted by rmadden <ma...@gmail.com>.
Dejan, thanks for the response.

I removed the line, but I am still seeing the message de-queued immediately. 
On the server side, I have set the schedulerSupport="true" in my
conf/acticemq-specjms.xml file, not sure what else to do ...

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

Re: Scheduler Broken?

Posted by Dejan Bosanac <de...@nighttale.net>.
The problem is that you are specifying job id. It is used only for other
actions on the already scheduled message (like remove). Try removing it and
it should work fine.

Regards
-- 
Dejan Bosanac - http://twitter.com/dejanb
-----------------
The experts in open source integration and messaging - http://fusesource.com
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net

Connect at CamelOne <http://camelone.com/> May 24-26

The Open Source Integration Conference



On Mon, May 23, 2011 at 10:58 PM, rmadden <ma...@gmail.com> wrote:

> The message is sent and goes through, but it is dequeued immediately, it
> does
> not wait the time specified in the header.
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Scheduler-Broken-tp3545460p3545468.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: Scheduler Broken?

Posted by rmadden <ma...@gmail.com>.
The message is sent and goes through, but it is dequeued immediately, it does
not wait the time specified in the header.

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