Uploaded image for project: 'WildFly WIP'
  1. WildFly WIP
  2. WFWIP-14

[Artemis upgrade] MDB cannot connect to remote server via RA if destination is not deployed locally

    XMLWordPrintable

Details

    • Hide
      git clone git://git.app.eng.bos.redhat.com/jbossqe/eap-tests-hornetq.git
      cd eap-tests-hornetq/scripts/
      groovy -DEAP_ZIP_URL=https://eap-qe-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/view/EAP7/view/EAP7-JMS/view/early-testing/view/tooling/job/early-testing-messaging-prepare/124/artifact/jboss-eap.zip PrepareServers7.groovy
      export WORKSPACE=$PWD
      export JBOSS_HOME_1=$WORKSPACE/server1/jboss-eap
      export JBOSS_HOME_2=$WORKSPACE/server2/jboss-eap
      export JBOSS_HOME_3=$WORKSPACE/server3/jboss-eap
      export JBOSS_HOME_4=$WORKSPACE/server4/jboss-eap
      
      cd ../jboss-hornetq-testsuite/
      
      mvn clean test -Dtest=ActivationConfigPropertiesTestCase#useJndiTest -DfailIfNoTests=false -Deap=7x -Deap7.org.jboss.qa.hornetq.apps.clients.version=7.1517218654-SNAPSHOT | tee log
      
      Show
      git clone git: //git.app.eng.bos.redhat.com/jbossqe/eap-tests-hornetq.git cd eap-tests-hornetq/scripts/ groovy -DEAP_ZIP_URL=https: //eap-qe-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/view/EAP7/view/EAP7-JMS/view/early-testing/view/tooling/job/early-testing-messaging-prepare/124/artifact/jboss-eap.zip PrepareServers7.groovy export WORKSPACE=$PWD export JBOSS_HOME_1=$WORKSPACE/server1/jboss-eap export JBOSS_HOME_2=$WORKSPACE/server2/jboss-eap export JBOSS_HOME_3=$WORKSPACE/server3/jboss-eap export JBOSS_HOME_4=$WORKSPACE/server4/jboss-eap cd ../jboss-hornetq-testsuite/ mvn clean test -Dtest=ActivationConfigPropertiesTestCase#useJndiTest -DfailIfNoTests= false -Deap=7x -Deap7.org.jboss.qa.hornetq.apps.clients.version=7.1517218654-SNAPSHOT | tee log

    Description

      For more information about origin of this issue see JBEAP-13857.

      Scenario

      • There are two servers called JMS servers which have deployed destinations
      • There are two servers called MDB servers which have configured RA to connect to JMS servers and have deployed MDBs
      • MDBs resend messages from InQueue to OutQueue

      Issue: RA on MDB servers is not able to connect to JMS servers.

      Detailed description of the issue

      There is an MDB with following activation config:

      @MessageDriven(name = "mdb1",
              activationConfig = {
                      @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
                      @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/queue/InQueue"),
                      @ActivationConfigProperty(propertyName = "rebalanceConnections", propertyValue = "true"),
                      @ActivationConfigProperty(propertyName = "hA", propertyValue = "true"),
                      @ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "color = 'RED'")})
      

      In ActiveMQActivation::setupDestination method there is a code which tries to do a JNDI lookup. If it fails the destination is created using the ActiveMQJMSClient::createQueue where the destination name is created from the JNDI name.

      try {
                     destination = (ActiveMQDestination) ActiveMQRaUtils.lookup(ctx, destinationName, destinationType);
                  } catch (Exception e) {
                     if (destinationName == null) {
                        throw ActiveMQRABundle.BUNDLE.noDestinationName();
                     }
      
                     String calculatedDestinationName = destinationName.substring(destinationName.lastIndexOf('/') + 1);
      
                     logger.debug("Unable to retrieve " + destinationName +
                                                      " from JNDI. Creating a new " + destinationType.getName() +
                                                      " named " + calculatedDestinationName + " to be used by the MDB.");
      
                     // If there is no binding on naming, we will just create a new instance
                     if (isTopic) {
                        destination = (ActiveMQDestination) ActiveMQJMSClient.createTopic(calculatedDestinationName);
                     } else {
                        destination = (ActiveMQDestination) ActiveMQJMSClient.createQueue(calculatedDestinationName);
                     }
                  }
      

      When the destination is not deployed locally (on the same server as MDB is deployed), the lookup fails and the destination is created using ActiveMQJMSClient::createQueue method, where calculatedDestinationName is InQueue.

      Later in the code, when RA tries to connect to the remote EAP server, it uses this destination when it creates a consumer. Since on the remote server there is no destination with core address InQueue, the request to create the consumer fails and it is being periodically retried.

      Attachments

        Issue Links

          Activity

            People

              mtaylor1@redhat.com Martyn Taylor (Inactive)
              eduda_jira Erich Duda (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: