我无法将Wildfly 14.0.1.Final配置为连接到远程Artemis服务器。这是我的standalone.xml:
<server name="default">
<security-setting name="#">
<role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
</security-setting>
<address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10"/>
<http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
<http-connector name="http-connector-throughput" socket-binding="http" endpoint="http-acceptor-throughput">
<param name="batch-delay" value="50"/>
</http-connector>
<remote-connector name="remote-artemis" socket-binding="remote-artemis"/>
<in-vm-connector name="in-vm" server-id="0">
<param name="buffer-pooling" value="false"/>
</in-vm-connector>
<http-acceptor name="http-acceptor" http-listener="default"/>
<http-acceptor name="http-acceptor-throughput" http-listener="default">
<param name="batch-delay" value="50"/>
<param name="direct-deliver" value="false"/>
</http-acceptor>
<in-vm-acceptor name="in-vm" server-id="0">
<param name="buffer-pooling" value="false"/>
</in-vm-acceptor>
<jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
<jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
<connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>
<connection-factory name="RemoteConnectionFactory" entries="java:jboss/exported/jms/RemoteConnectionFactory" connectors="http-connector"/>
<pooled-connection-factory name="activemq-ra" entries="java:/JmsXA" connectors="in-vm" transaction="xa"/>
<pooled-connection-factory name="remote-artemis" entries="java:/jms/remoteCF" connectors="remote-artemis" user="admin" password="admin"/>
</server>
这是我的MDB:
@ResourceAdapter("remote-artemis")
@MessageDriven(name = "ExampleMdb", activationConfig = {
@ActivationConfigProperty(propertyName = "destination", propertyValue = "DMSQueue"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "false"),
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge") })
public class ExampleMdb implements MessageListener {}
我在Artemis服务器上的DMSQueue地址中有DMSQueue。
这是我在Wildfly控制台中得到的:AMQ151001: Attempting to reconnect org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec(ra=org.wildfly.extension.messaging.activemq.ActiveMQResourceAdapter@9382da9c destination=queues/DMSQueue destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=admin password=**** maxSession=15)
和
AMQ151004: Instantiating javax.jms.Queue "DMSQueue" directly since UseJNDI=false.
我在Artemis Web控制台中看到的是,Wildfly和一个注册生产者存在两个连接和一个会话,但没有消费者。我也尝试使用Thorntail进行配置,但结果相同。
答案 0 :(得分:1)
我在这里查看文档:{{3}}
假设已定义了remote-artemis
套接字绑定(您没有显示),似乎您必须配置MDB以通过使用@org.jboss.ejb3.annotation.ResourceAdapter("remote-artemis")
进行注释来使用特定的资源适配器。
如果未通过此批注或其他方式将MDB配置为使用特定的资源适配器,则将使用ejb3
子系统中配置的默认资源适配器。
其余的配置看起来不错(根据文档,我不是消息传递方面的专家:-)。