I try to apply appropriate configuration to be able to use remote messaging system on artemis server through wildfly (also other environment members)
Firstly, i installed a standalone artemis server(2.0) on my local ( https://www.apache.org/dyn/closer.cgi?filename=activemq/activemq-artemis/2.0.0/apache-artemis-2.0.0-bin.zip&action=download )
Then i defined an example queueu on it. (exampleQueue)
I changed the standalone.xml file according to informations on https://docs.jboss.org/author/display/WFLY10/Connect+a+pooled-connection-factory+to+a+Remote+Artemis+Server
So, here is socket-binding-group:
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
<socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
...
<outbound-socket-binding name="mail-smtp">
<remote-destination host="localhost" port="25"/>
</outbound-socket-binding>
<outbound-socket-binding name="remote-artemis">
<remote-destination host="localhost" port="61616"/>
</outbound-socket-binding>
</socket-binding-group>
adapted messaging subsytem definition (had comprised embedded active-mq definitions and queues / topics before)
<subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
<server name="default">
<remote-connector name="remote-artemis" socket-binding="remote-artemis"/>
<in-vm-connector name="in-vm" server-id="0"/>
<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>
<pooled-connection-factory name="remote-artemis" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory java:/ConnectionFactory" connectors="remote-artemis" transaction="xa" user="s3artemisuser" password="s3artemispass"/>
</server>
</subsystem>
I also tried to include queues' jndi addresses essentially defined on remote artemis to be able to access from wildfly via injecting jndi resources. (followed this doc : https://activemq.apache.org/artemis/docs/1.0.0/using-jms.html )
<subsystem xmlns="urn:jboss:domain:naming:2.0">
<bindings>
<external-context name="java:global/jms" module="org.jboss.as.naming" class="javax.naming.directory.InitialDirContext" cache="true">
<environment>
<property name="java.naming.factory.initial" value="org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory"/>
<property name="connectionFactory.ConnectionFactory" value="tcp://localhost:5445"/>
<property name="java.naming.security.principal" value="s3artemisuser"/>
<property name="java.naming.security.credentials" value="s3artemispass"/>
</environment>
</external-context>
</bindings>
<remote-naming/>
</subsystem>
I have changed all resources injectin by jndi -temporarily to test- (which are used in producer and consumer classes)to refer remote queues/topics anymore.
class MyProducer extends BaseProducer {
@Resource(mappedName = "java:/global/jms/exampleQueue")
private Queue aQueue;
...
public abstract class BaseProducer extends JpaService {
@Resource(mappedName = "java:/ConnectionFactory")
protected ConnectionFactory connectionFactory; ... }
When i start the wildfly with these configurations, services are not being deployed properly. Although i provide the activemq-rar-5.14.0.rar file under my deployment folder, still same error occurs. What am i missing here, what is the right configuration for my situation ?
10:19:13,701 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "my-module-using-jms-ear-2.0-SNAPSHOT.ear")]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.ra.activemq-ra"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…