3 Replies Latest reply on Jan 19, 2018 11:34 AM by crinaboitor

    MDB not connecting to remote Artemis cluster with failover

    crinaboitor

      Hi,

       

      I have a Wildfly 10 instance app and I managed to connect to a remote Artemis standalone with the following MDB config:

       

      @MessageDriven(name = "HPWOProcessorMDB",
         activationConfig =

        {

         @ActivationConfigProperty(propertyName = "connectionFactoryLookup", propertyValue = "java:/JmsXA"),
         @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
         @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "HPWOQueue"),
         @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
         @ActivationConfigProperty(propertyName = "useDLQ", propertyValue = "false"),
         //@ActivationConfigProperty(propertyName = "UseJNDI", propertyValue = "false"),
         @ActivationConfigProperty(propertyName = "hA", propertyValue = "true"),
         @ActivationConfigProperty(propertyName = "transactionTimeout", propertyValue = "1200"),
         @ActivationConfigProperty(propertyName = "reconnectAttempts", propertyValue = "-1"),
         @ActivationConfigProperty(propertyName = "setupAttempts", propertyValue = "-1"),
         //@ActivationConfigProperty(propertyName = "connectorClassName", propertyValue = "org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory"),
        //@ActivationConfigProperty(propertyName = "connectionParameters", propertyValue = "host=@remote@;port=61616;httpUpgradeEnabled")

         }
      )

      The last two properties failed to work so I did a lookup on the connection factory defined in the pooled-connection:

      ...

      <remote-connector name="artemis1" socket-binding="artemis1"/>

      ...

      <pooled-connection-factory name="remote-artemis" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="artemis1" transaction="xa"/>

      ...

      <outbound-socket-binding name="artemis1">

                  <remote-destination host="@remote@" port="61616"/>

          </outbound-socket-binding>

       

      My problem is that attempting to connect to a shared-store cluster the MDB attempts to connect locally again. I see the following in the server log.

       

      [ActiveMQActivation] (default-threads - 3) AMQ151005: awaiting server availability

      [ActiveMQActivation] (default-threads - 1) AMQ151001:Attempting to reconnect org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec(ra=org.apache.activemq.artemis.ra.ActiveMQResourceAdapter@4d2178f3 connectionFactoryLookup=java:/JmsXA destination=HPWOQueue destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=null maxSession=15)

       

      I tried this solution: How to connect to a cluster of Artemis MQ servers?

      <discovery-group name="dg-group1" socket-binding="artemis-discovery"/>

      <pooled-connection-factory name="remote-artemis" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" discovery-group="dg-group1" transaction="xa"/>

      ...

      <interface name="messenger"> 

              <any-address/> 

          </interface>

      <socket-binding name="artemis-discovery" interface="messenger" multicast-address="231.7.7.7" multicast-port="9876"/>

      But I still see the same message in the log.

       

      If you have any suggestions, I would highly appreciate.

      Thanks,

      Crina