Wildfly 10.1 fails to deploy app during Artemis failback
asimmahmood Sep 6, 2016 5:57 AMHi all,
I’m attempting to run two instances of Wildfly 10.1 in a cluster. Both instances are running 2 Artemis activemq servers, one which is live and one which backs up the live server on the other Wildfly instance. The live backup pairs are configured to use network replication to synchronise their data.
The issue I’m having is that my application will fail to deploy if the live Artemis instance needs to synchronise with the backup Artemis instance at startup (during failback). The errors I’m getting are:
"WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.jboss.DefaultJMSConnectionFactory
And
"Services that may be the cause:" => [
"jboss.naming.context.java.JmsXA",
"jboss.naming.context.java.jboss.DefaultJMSConnectionFactory",
"jboss.ra.activemq-ra"
]
Shortly after getting these errors I can see the following messages in the logs:
WFLYJCA0002: Bound JCA ConnectionFactory [java:/JmsXA]
WFLYMSGAMQ0002: Bound messaging object to jndi name java:jboss/DefaultJMSConnectionFactory
I believe Wildfly is attempting to deploy my application before Artemis is ready. In the case of a failback the backup server (which became live) needs to replicate its state to the live server before it can start up. This will obviously take a little longer than a clean startup. I believe it is this extra time which is causing Artemis to startup later, and as a result the connection factories aren’t available when the application is deployed.
Is there a way to ensure my application is only deployed when Artemis has been completely initialised? My configuration for the messaging-activemq subsystem is shown below. Is there anything in my configuration that could be causing this issue? I start the first node with jboss.node.name system property set to node-1 and artemis.backup.node.name set to node-2. The second node has jboss.node.name set to node-2 and artemis.backup.node.name set to node-1
<subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0"> <server name="default"> <cluster password="${jboss.messaging.cluster.password:CHANGE ME!!}"/> <replication-master check-for-live-server="true" group-name="${jboss.node.name:node-1}" cluster-name="my-cluster"/> <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" redistribution-delay="1000"/> ... (address-settings) <remote-connector name="netty" socket-binding="messaging"/> <remote-connector name="netty-throughput" socket-binding="messaging-throughput"> <param name="batch-delay" value="50"/> </remote-connector> <in-vm-connector name="in-vm" server-id="0"/> <remote-acceptor name="netty" socket-binding="messaging"/> <remote-acceptor name="netty-throughput" socket-binding="messaging-throughput"> <param name="batch-delay" value="50"/> <param name="direct-deliver" value="false"/> </remote-acceptor> <in-vm-acceptor name="in-vm" server-id="0"/> <broadcast-group name="bg-group1" jgroups-channel="activemq-cluster" connectors="netty"/> <discovery-group name="dg-group1" jgroups-channel="activemq-cluster"/> <cluster-connection name="my-cluster" address="jms" connector-name="netty" discovery-group="dg-group1"/> <jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/> <jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/> ... (jms-queues) <connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/> <connection-factory name="RemoteConnectionFactory" entries="java:jboss/exported/jms/RemoteConnectionFactory" connectors="netty" ha="true" block-on-acknowledge="true" reconnect-attempts="-1"/> <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/> </server> <server name="backup"> <cluster password="${jboss.messaging.cluster.password:CHANGE ME!!}"/> <replication-slave max-saved-replicated-journal-size="-1" group-name="${artemis.backup.node.name:node-2}" cluster-name="my-cluster"/> <bindings-directory path="activemq/bindings-backup"/> <journal-directory path="activemq/journal-backup"/> <large-messages-directory path="activemq/largemessages-backup"/> <paging-directory path="activemq/paging-backup"/> <address-setting name="#" redistribution-delay="0" page-size-bytes="524288" max-size-bytes="1048576" max-delivery-attempts="200"/> <remote-connector name="netty-backup" socket-binding="messaging-backup"/> <in-vm-connector name="in-vm" server-id="1"/> <remote-acceptor name="netty-backup" socket-binding="messaging-backup"/> <broadcast-group name="bg-group-backup" connectors="netty-backup" jgroups-channel="activemq-cluster"/> <discovery-group name="dg-group-backup" jgroups-channel="activemq-cluster"/> <cluster-connection name="my-cluster" discovery-group="dg-group-backup" connector-name="netty-backup" address="jms"/> </server> </subsystem> ... <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}"> ... <socket-binding name="messaging" port="5445"/> <socket-binding name="messaging-backup" port="5446"/> <socket-binding name="messaging-throughput" port="5447"/> ... </socket-binding-group>
Any help would be greatly appreciated.
Thanks,
Asim