我想在资源适配器子系统中使用module
标记(而不是archive
标记)来简化部署任务并仅进行有意义的部署,以便操作人员不会对其进行操作
带有resource-adapter
标记的archive
配置工作正常(名称与其部署之一匹配),因此,standalone-full-ha.xml的其余部分都很好。有关资源适配器子系统的配置,请参见下文。
我尝试过的事情:
尝试1:
我创建了自己的artemis ra模块版本,因为我们使用artemis 2.6.0作为从提供的版本中启发(并改编)的代理版本,并将模块文件放置在$ wildfly_home / modules中。参见下面的module.xml
我用正确的模块名称(org.apache.activemq.artemis.ra)和插槽(2.6.0)将archive
标签替换为module
标签,但是没有运气。
启动时在日志中出现以下错误:
[org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 69) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "resource-adapters"),("resource-adapter" => "remote-artemis-ra")
]) - failure description: "WFLYJCA0073: Failed to load module for RA [org.apache.activemq.artemis.ra]"
但是我觉得这没有帮助。
尝试2:
与上述相同,但使用提供的ra模块(实际上只是删除了slot属性)。结果相同。
在org.jboss.as.connector.subsystems.resourceadapters.RaOperationUtil#installRaServicesAndDeployFromModule
中进行调试表明它尝试加载Meta-INF/ra.xml
文件,如果找不到该文件,则会失败。
即使使用提供的artemis-ra模块(wildfly 13中的1.5.5),我也不知道该如何工作,因为它没有此文件。它以某种方式被resource-adapter
子系统配置取代了吗?
当前无法升级到较新版本的wildfly。也许在未来的几个月中。对于artemis,也是如此,以防由于错误修复而导致。
任何帮助,不胜感激!
我的自定义artemis模块(2.6.0)的module.xml
<module name="org.apache.activemq.artemis.ra" slot="2.6.0" xmlns="urn:jboss:module:1.5">
<properties>
<property name="jboss.api" value="private"/>
</properties>
<resources>
<resource-root path="Meta-INF"/>
<resource-root path="artemis-ra-2.6.0.jar"/>
</resources>
<dependencies>
<module name="io.netty" slot="4.1.24"/>
<module name="javax.api"/>
<module name="javax.jms.api"/>
<module name="javax.resource.api"/>
<module name="org.apache.activemq.artemis" slot="2.6.0"/>
<module name="org.jboss.as.transactions"/>
<module name="org.jboss.jboss-transaction-spi"/>
<module name="org.jboss.jts"/>
<module name="org.jboss.logging"/>
<!-- allow to create a RA that connects to a remote Artemis server -->
<module name="org.wildfly.naming-client" optional="true"/>
<module name="org.jgroups" slot="3.6.13"/>
<module name="org.wildfly.extension.messaging-activemq" services="import"/>
</dependencies>
<export>
<inclue path="Meta-INF/ra.xml" />
</export>
</module>
也尝试没有Meta-INF,也没有运气。还尝试将root-resource作为.
包含artemis-ra-2.6.0.jar和meta-inf文件夹,启动时出现相同的错误。
依赖项会相应创建,并且似乎已成功加载(启动时唯一的错误是与artemis-ra相关的错误)。
资源适配器子系统
<subsystem xmlns="urn:jboss:domain:resource-adapters:5.0">
<resource-adapters>
<resource-adapter id="remote-artemis-ra">
<module slot="2.6.0" id="org.apache.activemq.artemis.ra"/>
<transaction-support>XATransaction</transaction-support>
<config-property name="ConfirmationWindowSize">
50
</config-property>
<config-property name="DiscoveryRefreshTimeout">
3333
</config-property>
<config-property name="password">
admin
</config-property>
<config-property name="ClientFailureCheckPeriod">
100
</config-property>
<config-property name="MaxRetryInterval">
3000
</config-property>
<config-property name="ConnectionParameters">
host=localhost;port=61616
</config-property>
<config-property name="HA">
true
</config-property>
<config-property name="RetryInterval">
4444
</config-property>
<config-property name="connectorClassname">
org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory
</config-property>
<config-property name="ConnectionLoadBalancingPolicyClassname">
org.apache.activemq.artemis.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy
</config-property>
<config-property name="username">
admin
</config-property>
<config-property name="ReconnectAttempts">
10
</config-property>
<connection-definitions>
<connection-definition class-name="org.apache.activemq.artemis.ra.activeMQRAManagedConnectionFactory" jndi-name="java:/raconnectionFactory" enabled="true" pool-name="raconnectionFactory">
<xa-pool>
<min-pool-size>25</min-pool-size>
<max-pool-size>30</max-pool-size>
<prefill>true</prefill>
<is-same-rm-override>false</is-same-rm-override>
</xa-pool>
</connection-definition>
</connection-definitions>
</resource-adapter>
</resource-adapters>
</subsystem>