You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by GregTom <gr...@gmail.com> on 2015/06/29 18:01:17 UTC

Enabling scheduleSupport

I am using ActiveMQ as the JMS implementation in TomEE server. I have never
configured it, I just use the pure default configuration and it works well.
Now I would like to use delay feature for some JMS messages. I founded that
ActiveMQ has this feature:

message.setLongProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY, delayMinute *
60000);

But the message is not delayed at all. Probably because schedulerSupport
attribute should be set to true. How can I set this in TomEE? I don't want
to change anything on the default configuration. I only want to turn on
scheduler support.

Can somebody help me to turn on scheduler support in ActiveMQ of TomEE?

[I use TomEE Plus 1.7.1]

Thank you in advance.



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

Re: Enabling scheduleSupport

Posted by GregTom <gr...@gmail.com>.
I managed to solve the problem, so I write it here to document it:

To configure ActiveMQ broker in TomEE, and turn on schedulerSupport with
KahaDB, we should put these lines into tomee.xml:

<Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
    BrokerXmlConfig =
broker:(tcp://127.0.0.1:61616)?usekahadb=true&amp;persistent=true&amp;schedulerSupport=true
</Resource>

<Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory">
    ResourceAdapter = MyJmsResourceAdapter
</Resource>

One more thing is necessary to make this work:
ActiveMQ puts some folders for KahaDB into tomee's bin folder, so this
folder must be writeable for tomee process at least for the first run. After
necessary subfolders are created, bin folder can be changed back to not
writeable.




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

Re: Enabling scheduleSupport

Posted by GregTom <gr...@gmail.com>.
Thank you your answer.

Where should I put this broker configuration:

<broker xmlns="http://activemq.apache.org/schema/core"
brokerName="localhost" dataDirectory="${activemq.data}"
schedulerSupport="true"> 

I don't have a config file in TomEE conf directory which contains such
things.
in the /conf directory of TomEE there is a server.xml, tomee.xml, web.xml,
context.xml file.
Into which should I put the broker configuration?

If I really had a default configuration file for activemq, I would be able
to modify it. But I don't have such a file. I think somehow ActiveMQ has an
implicit default configuration that I cannot modify and I don't know where
to put the modification (and how).




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

Re: Enabling scheduleSupport

Posted by Timothy Bish <ta...@gmail.com>.
On 06/29/2015 12:01 PM, GregTom wrote:
> I am using ActiveMQ as the JMS implementation in TomEE server. I have never
> configured it, I just use the pure default configuration and it works well.
> Now I would like to use delay feature for some JMS messages. I founded that
> ActiveMQ has this feature:
>
> message.setLongProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY, delayMinute *
> 60000);
>
> But the message is not delayed at all. Probably because schedulerSupport
> attribute should be set to true. How can I set this in TomEE? I don't want
> to change anything on the default configuration. I only want to turn on
> scheduler support.
>
> Can somebody help me to turn on scheduler support in ActiveMQ of TomEE?
>
> [I use TomEE Plus 1.7.1]
>
> Thank you in advance.
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Enabling-scheduleSupport-tp4698334.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Scheduler support is disabled by default in ActiveMQ. In order to use it
you must set the property 'schedulerSupport' to true which means you
will need to modify the default broker configuration, no way around that.

|<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" schedulerSupport="true">
|


-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.redhat.com 
twitter: @tabish121
blog: http://timbish.blogspot.com/