两个步骤:参考地址:http://activemq.apache.org/interceptors.html
1、开发插件类
插件类需要实现接口org.apache.activemq.broker.BrokerPlugin
activeMQ已有的实现类,如下
继承:org.apache.activemq.broker.BrokerPluginSupport=》BrokerFilter类=》BrokerPlugin接口
import org.apache.activemq.broker.Broker; import org.apache.activemq.broker.BrokerPlugin; public class MyPlugin implements BrokerPlugin { public Broker installPlugin(Broker broker) throws Exception { return new MyBroker(broker); } }
2、配置activeMQ
<broker xmlns="http://activemq.org/config/1.0" brokerName="localhost" dataDirectory="${activemq.base}/data"> <!-- The transport connectors ActiveMQ will listen to --> <transportConnectors> <transportConnector name="openwire" uri="tcp://localhost:61616" /> </transportConnectors> <plugins> <bean id="myPlugin" class="org.myorg.MyPlugin"/> </plugins> </broker>
======================
今天重新测试了一下,发现XML解析有问题,可是看activemq.xsd是OK的呀,也没有顺序才是。实现是想不出怎么做。完全按照教程上来的也解释有问题,可能是一个小细节或者包冲突导致。
但是没有时间去细化问题,只想了一个绕过去的办法——本身activemq的配置文件是基于spring来实现的。那完全可以通过spring在broker实例化之前加上plugins配置信息。
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'bean'. One of '{"http://activemq.apache.org/schema/core":authorizationPlugin, "http://activemq.apache.org/schema/core":connectionDotFilePlugin, "http://activemq.apache.org/schema/core":destinationDotFilePlugin, "http://activemq.apache.org/schema/core":discardingDLQBrokerPlugin, "http://activemq.apache.org/schema/core":forcePersistencyModeBrokerPlugin, "http://activemq.apache.org/schema/core":jaasAuthenticationPlugin, "http://activemq.apache.org/schema/core":jaasCertificateAuthenticationPlugin, "http://activemq.apache.org/schema/core":jaasDualAuthenticationPlugin, "http://activemq.apache.org/schema/core":loggingBrokerPlugin, "http://activemq.apache.org/schema/core":multicastTraceBrokerPlugin, "http://activemq.apache.org/schema/core":simpleAuthenticationPlugin, "http://activemq.apache.org/schema/core":statisticsBrokerPlugin, "http://activemq.apache.org/schema/core":timeStampingBrokerPlugin, "http://activemq.apache.org/schema/core":traceBrokerPathPlugin, "http://activemq.apache.org/schema/core":udpTraceBrokerPlugin, WC[##other:"http://activemq.apache.org/schema/core"]}' is expected. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
相关推荐
ActiveMQ插件
ActiveMQ手册 - 开发文档 开发手册 ActiveMQ手册 - 开发文档 开发手册
C#客户端开发ActiveMq请下载Apache.NMS和Apache.NMS.ActiveMQ两个bin包
activemq开发文档activemq开发文档activemq开发文档activemq开发文档
activemq-cpp开发手册
用于Delphi的ActiveMq开发,开发有关队列的操作,入队、出队等队列操作
ActiveMQ插件,用于连接验证 在外部activeMQ服务器中加入验证插件:插件加入地址为activeMQ/lib activeMQ.xml植入的配置文件 < value>http://127.0.0.1:8082/activeMQ/checkSecret</
NULL 博文链接:https://wdzwdz.iteye.com/blog/1154217
springboot集成activemq实现消息接收demo
适用于Java后台开发消息队列ActiveMQ使用者,包括服务器的搭建以及ActiveMQ的三种使用模式
ActiveMQ开发规范及方案
基于SpringBoot开发的ActiveMQ虚拟主题客户端,达到消费者多点消费、负载均衡和故障转移的目的。 详情可以参考这里: https://my.oschina.net/noryar/blog/1573047 https://my.oschina.net/noryar/blog/1575003
ActiveMQ开发实例-3,开发工程配置说明,需配合ActiveMQ开发实例系列其他资源使用
activeMq in action 使用activeMq开发JMS的简单讲述,activeMq in action 使用activeMq开发JMS的简单讲述
ActiveMQ开发实例-5,ActiveMQ运行包,已验证可直接使用,需配合ActiveMQ开发实例系列其他资源使用
ActiveMQ 开发例子初学者可以看看
ActiveMQ开发实例-2,使用源码,需配合ActiveMQ开发实例系统其他资源使用
ActiveMQ开发实例核心内容,本人使用ActiveMQ开发的使用总结,版权所有归属本人,如果要引用请注明出处。需配合ActiveMQ开发实例系列其他资源使用
qt5.8 msvc2015 加载activemq 成功自发自首,编写了模块,可以自行下载,activemq里面的dll,也都存在, 调用方法 CSpiderPluginAMq::GetInstance()->InitNetwork(); CSpiderPluginAMq::GetInstance()->...