如何在 TomEE ActiveMQ 中开启 schedulerSupport [英] How to turn on schedulerSupport in TomEE ActiveMQ

查看:59
本文介绍了如何在 TomEE ActiveMQ 中开启 schedulerSupport的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从来没有配置过activemq,我只是在TomEE Plus 1.7.1中使用完全默认的配置并且它完美地工作.我使用 JMS 进行异步电子邮件发送.现在我想使用调度程序支持,如下所示:

I have never configured activemq, I just use the totally default configuration in TomEE Plus 1.7.1 and it works perfectly. I use JMS for asynchron e-mail sending. Now I would like to use the scheduler support, like this:

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

但消息不会延迟.我读到应该在 xml 文件(可能是 activemq.xml (?))中打开 schedulerSupport,但我没有这样的文件.

But message is not delayed. I read that schedulerSupport should have been turned on in an xml file (probably activemq.xml (?)) but I don't have such a file.

我在 tomee.xml 中尝试过这个,但它不起作用:

I tried this in tomee.xml, but it does not work:

<Resource id="myActiveMQResourceAdapter" type="ActiveMQResourceAdapter">
    schedulerSupport = true
</Resource>

我应该把 schedulerSupport = true 配置属性放在哪里?我不想声明新的 Broker 或任何其他东西.只是我想使用默认设置加上调度程序支持.

Where should I put the schedulerSupport = true configuration property? I don't want to declare new Broker's or any other things. Just I would like to use the default settings plus scheduler support.

推荐答案

默认情况下,ActiveMQ 中禁用了调度程序支持.为了使用它,您必须将属性 'schedulerSupport' 设置为 true,这意味着您需要修改默认代理配置,无法绕过.

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">

这篇关于如何在 TomEE ActiveMQ 中开启 schedulerSupport的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆