4.9.4. 迁移消息传递拦截器
JBoss EAP 7 中的消息传递拦截器已发生了重大变化,将 HornetQ 替换为 JMS 消息传递提供程序 ActiveMQ Artemis。
之前的 JBoss EAP 版本中包含的 HornetQ 消息传递 子系统要求您安装 HornetQ 拦截器,方法是将它们添加到 JAR 中,然后修改 HornetQ 模块.xml 文件。
JBoss EAP 7 中包含的 messaging-activemq 子系统不需要修改 module.xml 文件。用户拦截器类现在实施 Apache ActiveMQ Artemis Interceptor 接口,现在可以从任何服务器模块加载。您可以指定拦截器应从中加载到服务器配置文件的 messaging-activemq 子系统中的模块。
示例:拦截器配置
<subsystem xmlns="urn:jboss:domain:messaging-activemq:4.0">
<server name="default">
...
<incoming-interceptors>
<class name="com.mycompany.incoming.myInterceptor" module="com.mycompany" />
<class name="com.othercompany.incoming.myOtherInterceptor" module="com.othercompany" />
</incoming-interceptors>
<outgoing-interceptors>
<class name="com.mycompany.outgoing.myInterceptor" module="com.mycompany" />
<class name="com.othercompany.outgoing.myOtherInterceptor" module="com.othercompany" />
</outgoing-interceptors>
</server>
</subsystem>