4

We have a setup of JBoss EAP 7.0.0.GA connecting to ActivMQ apache-activemq-5.14.3. We are trying to setup a durable subscriber with the following configuration:

@MessageDriven(
      name = "TestListener",
      activationConfig = {
        @ActivationConfigProperty(propertyName  = "destinationType",
                                      propertyValue = "javax.jms.Topic"),

        @ActivationConfigProperty(propertyName  = "subscriptionDurability",
                                      propertyValue = "Durable"),

        @ActivationConfigProperty(propertyName  = "subscriptionName",
              propertyValue = "subscriptionNameTest"),

        @ActivationConfigProperty(propertyName  = "clientId",
                                      propertyValue = "2"),

        @ActivationConfigProperty(propertyName  = "destination",
                                      propertyValue = "jms/testTopic")
      }
)
@PermitAll
@ResourceAdapter(value="activemq-rar.rar")

However, we are getting the following exception in the JBoss server console

ERROR [org.apache.activemq.ra.ActiveMQEndpointWorker] (default-threads - 4) Failed to connect to broker [tcp://127.0.0.1:61616?jms.rmIdFromConnectionId=true]: Broker: TestBroker    - Client: 2 already connected from tcp://127.0.0.1:64246: javax.jms.InvalidClientIDException: Broker: TestBroker - Client: 2 already connected from tcp://127.0.0.1:64246

At the same time if we see the following logs at the activmq :

WARN  | Failed to add Connection ID: 40600-51:1 due to javax.jms.InvalidClientIDException: Broker: TestBroker - Client: 2 already connected from tcp://127.0.0.1:64246 | org.apache.activemq.broker.TransportConnection | ActiveMQ Transport: tcp:///127.0.0.1:50170@61616

The ActiveMQManagedConnectionFactory settings are as follows (tried setting the max-pool-size to 1, but to no effect):

/subsystem=resource-adapters/resource-adapter=activemq-rar.rar/connection-definitions=ConnectionFactory:add(class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory", jndi-name="java:/MyConnectionFactory", enabled=true, min-pool-size=1, max-pool-size=20, pool-prefill=false, same-rm-override=false, recovery-username=ejb_user, recovery-password=xxxxx)

Request help from AMQ experts please.

Dchucks
  • 1,189
  • 5
  • 22
  • 48

2 Answers2

0

only way I have been able to get AMQ and jboss to behave without a thousand threads doing stupid things is to setup the RAR with an embedded broker and then network connect the embedded broker with your external broker.

FredsterL
  • 1
  • 2
  • 2
    I am not understanding what you are saying here. Can you provide more detail? – Stephen Rauch Apr 07 '18 at 02:01
  • part of the setup of the activemq rar file is to configure the broker.xml file. In this file, you can enable an embedded broker that would be network connected to an external broker. refer to http://activemq.apache.org/resource-adapter-properties.html – FredsterL Apr 08 '18 at 21:29
-2

Perhaps, changing your property/configuration would solve your issue. Try for example to change your client id by using the following configuration:

@ActivationConfigProperty(propertyName="clientId", propertyValue = "2-${jboss.node.name}")

This will ensure that your clientId is unique

  • 1
    Thanks Yogesh, we did try the Property replacement way, to have the ClientId being set dynamically, sadly to no respite. We still get the same error. We have only single node setup with connection factory pool setup to Max 1 connection still multiple threads try to connect using same ClientId. – Dchucks Mar 16 '17 at 11:27