activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Bertram <jbert...@apache.com>
Subject Re: Artemis - Load balance setup - ActiveMQNonExistentQueueException
Date Tue, 30 Aug 2016 14:35:43 GMT
Try using Artemis 1.3.0 (released in June) which contains the fix for ARTEMIS-218.  Or you
could just pre-configure your queues.

Also, you should set the redistribution-delay to something > 0 (the default is -1).  For
more information on this see the "Message Redistribution" section in the documentation [1].


Justin

[1] http://activemq.apache.org/artemis/docs/1.3.0/clusters.html

----- Original Message -----
From: "anton.mithun" <mithunantonrulez@gmail.com>
To: users@activemq.apache.org
Sent: Tuesday, August 30, 2016 12:53:20 AM
Subject: Re: Artemis - Load balance setup - ActiveMQNonExistentQueueException

We are using artemis 1.2.0

---------------------------
node1 - broker.xml -----------------------------

<?xml version='1.0'?>

<configuration xmlns="urn:activemq"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="urn:activemq
/schema/artemis-configuration.xsd">

   <jms xmlns="urn:activemq:jms">
      <queue name="DLQ"/>
      <queue name="ExpiryQueue"/>

   </jms>

   <core xmlns="urn:activemq:core">

      <name>0.0.0.0</name>

      <persistence-enabled>true</persistence-enabled>

      
      <journal-type>ASYNCIO</journal-type>

      <paging-directory>./data/paging</paging-directory>

      <bindings-directory>./data/bindings</bindings-directory>

      <journal-directory>./data/journal</journal-directory>

     
<large-messages-directory>./data/large-messages</large-messages-directory>

      <journal-min-files>2</journal-min-files>

      <journal-pool-files>-1</journal-pool-files>

      
      <journal-buffer-timeout>140000</journal-buffer-timeout>

     
      <connectors>
         <connector
name="netty-connector">tcp://192.168.1.143:61616</connector>
      </connectors>

      <acceptors>
        
       
       <acceptor
name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>

       
       <acceptor name="amqp">tcp://0.0.0.0:5672?protocols=AMQP</acceptor>

       
       <acceptor name="stomp">tcp://0.0.0.0:61613?protocols=STOMP</acceptor>

       
       <acceptor
name="hornetq">tcp://0.0.0.0:5445?protocols=HORNETQ,STOMP</acceptor>

       
       <acceptor name="mqtt">tcp://0.0.0.0:1883?protocols=MQTT</acceptor>

       <acceptor name="netty-acceptor">tcp://192.168.1.143:61616</acceptor>

      </acceptors>

      <broadcast-groups>
         <broadcast-group name="bg-group1">
            <group-address>231.7.7.8</group-address>
            <group-port>9876</group-port>
            <broadcast-period>1000</broadcast-period>
            <connector-ref>netty-connector</connector-ref>
         </broadcast-group>
      </broadcast-groups>

      <discovery-groups>
         <discovery-group name="dg-group1">
            <group-address>231.7.7.8</group-address>
            <group-port>9876</group-port>
            <refresh-timeout>60000</refresh-timeout>
         </discovery-group>
      </discovery-groups>

      <cluster-user>user</cluster-user>
      <cluster-password>pass</cluster-password>

      <cluster-connections>
         <cluster-connection name="my-cluster">
            <address>jms</address>
            <connector-ref>netty-connector</connector-ref>
            <retry-interval>500</retry-interval>
            <retry-interval-multiplier>1.0</retry-interval-multiplier>
            <max-retry-interval>5000</max-retry-interval>
            <reconnect-attempts>-1</reconnect-attempts>
            <message-load-balancing>ON_DEMAND</message-load-balancing>
            <max-hops>1</max-hops>
            <discovery-group-ref discovery-group-name="dg-group1"/>
         </cluster-connection>

      </cluster-connections>

      <security-enabled>true</security-enabled>

      <security-settings>
                   <security-setting match="#">
                      <permission type="createDurableQueue" roles="amq"/>
                      <permission type="deleteDurableQueue" roles="amq"/>
                      <permission type="createNonDurableQueue" roles="amq"/>
                      <permission type="deleteNonDurableQueue" roles="amq"/>
                      <permission type="send" roles="amq"/>
                      <permission type="consume" roles="amq"/>
                   </security-setting>
     </security-settings>

      <address-settings>
         
         <address-setting match="#">
            <dead-letter-address>jms.queue.DLQ</dead-letter-address>
            <expiry-address>jms.queue.ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
            <max-size-bytes>10485760</max-size-bytes>
           
<message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>BLOCK</address-full-policy>
            <auto-create-jms-queues>true</auto-create-jms-queues>
            <auto-delete-jms-queues>false</auto-delete-jms-queues>
         </address-setting>
      </address-settings>
   </core>
</configuration>

---------------------------------------------

node2 - broker.xml --------------------------

<?xml version='1.0'?>

<configuration xmlns="urn:activemq"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="urn:activemq
/schema/artemis-configuration.xsd">

   <jms xmlns="urn:activemq:jms">
      <queue name="DLQ"/>
      <queue name="ExpiryQueue"/>

   </jms>

   <core xmlns="urn:activemq:core">

      <name>0.0.0.0</name>

      <persistence-enabled>true</persistence-enabled>

      
      <journal-type>ASYNCIO</journal-type>

      <paging-directory>./data/paging</paging-directory>
      
      <bindings-directory>./data/bindings</bindings-directory>

      <journal-directory>./data/journal</journal-directory>

     
<large-messages-directory>./data/large-messages</large-messages-directory>

      <journal-min-files>2</journal-min-files>

      <journal-pool-files>-1</journal-pool-files>

      
      <journal-buffer-timeout>140000</journal-buffer-timeout>

      
       <connectors>
          <connector
name="netty-connector">tcp://192.168.1.42:61616</connector>
       </connectors>

      <acceptors>
         
         
         <acceptor
name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>

         
         <acceptor name="amqp">tcp://0.0.0.0:5672?protocols=AMQP</acceptor>

         
         <acceptor
name="stomp">tcp://0.0.0.0:61613?protocols=STOMP</acceptor>

         
         <acceptor
name="hornetq">tcp://0.0.0.0:5445?protocols=HORNETQ,STOMP</acceptor>

         
         <acceptor name="mqtt">tcp://0.0.0.0:1883?protocols=MQTT</acceptor>

         <acceptor name="netty-acceptor">tcp://192.168.1.42:61616</acceptor>
          </acceptors>

      <broadcast-groups>
         <broadcast-group name="bg-group1">
            <group-address>231.7.7.8</group-address>
            <group-port>9876</group-port>
            <broadcast-period>1000</broadcast-period>
            <connector-ref>netty-connector</connector-ref>
         </broadcast-group>
      </broadcast-groups>

      <discovery-groups>
         <discovery-group name="dg-group1">
            <group-address>231.7.7.8</group-address>
            <group-port>9876</group-port>
            <refresh-timeout>60000</refresh-timeout>
         </discovery-group>
      </discovery-groups>

      <cluster-user>user</cluster-user>
      <cluster-password>pass</cluster-password>

      <cluster-connections>
            <cluster-connection name="my-cluster">
               <address>jms</address>
               <connector-ref>netty-connector</connector-ref>
               <retry-interval>500</retry-interval>
               <retry-interval-multiplier>1.0</retry-interval-multiplier>
               <max-retry-interval>5000</max-retry-interval>
               <reconnect-attempts>-1</reconnect-attempts>
               <message-load-balancing>ON_DEMAND</message-load-balancing>
               <max-hops>1</max-hops>
               <discovery-group-ref discovery-group-name="dg-group1"/>
            </cluster-connection>
         </cluster-connections>


         <security-enabled>true</security-enabled>

         <security-settings>
               <security-setting match="#">
                  <permission type="createDurableQueue" roles="amq"/>
                  <permission type="deleteDurableQueue" roles="amq"/>
                  <permission type="createNonDurableQueue" roles="amq"/>
                  <permission type="deleteNonDurableQueue" roles="amq"/>
                  <permission type="send" roles="amq"/>
                  <permission type="consume" roles="amq"/>
               </security-setting>
        </security-settings>

         <address-settings>
            
            <address-setting match="#">
               <dead-letter-address>jms.queue.DLQ</dead-letter-address>
               <expiry-address>jms.queue.ExpiryQueue</expiry-address>
               <redelivery-delay>0</redelivery-delay>
               <max-size-bytes>10485760</max-size-bytes>
              
<message-counter-history-day-limit>10</message-counter-history-day-limit>
               <address-full-policy>BLOCK</address-full-policy>
               <auto-create-jms-queues>true</auto-create-jms-queues>
               <auto-delete-jms-queues>false</auto-delete-jms-queues>
            </address-setting>
         </address-settings>

            </core>
</configuration>

-------------------------------

I didnt take the exact code from our application, there is a lot of spring
injection and stuffs. 
Instead just to simplify I have shared sample codes for sending and
receiving.

-------------------------------
public class SendFromNode1 {

    public static void main(String[] args) {
        Connection con = null;
        ActiveMQConnectionFactory cf = null;
        Queue serviceQueue = null;
        try {
            try {
                cf = new
ActiveMQConnectionFactory("tcp://192.168.1.143:61616");
                con = cf.createConnection("amq", "amq");
            } catch (JMSSecurityException e) {
                e.printStackTrace();
            }
            con.start();
            Session session = con.createSession(false,
Session.AUTO_ACKNOWLEDGE);
            serviceQueue = (Queue) session.createQueue("DemoService");
            MessageProducer producer = session.createProducer(serviceQueue);
            ObjectMessage objectMessage = session.createObjectMessage();
            objectMessage.setObject("Test message");
            producer.send(objectMessage);
            con.stop();
            System.out.println("Sent message: " +
objectMessage.getObject().toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
-------------------------------
public class ReceiveInNode1 {

    public static void main(String[] args) {
        Connection con = null;
        ConnectionFactory cf = null;
        Queue serviceQueue = null;
        try {
            cf = new ActiveMQConnectionFactory("tcp://192.168.1.143:61616");
            con = cf.createConnection("amq", "amq");
            con.start();
            Session session = con.createSession(false,
Session.AUTO_ACKNOWLEDGE);
            serviceQueue = (Queue) session.createQueue("DemoService");
            MessageConsumer messageConsumer =
session.createConsumer(serviceQueue);
            ProxyListener messageServiceListener = new ProxyListener();
            messageConsumer.setMessageListener(messageServiceListener);
            while(true);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
-------------------------------
public class ReceiveInNode2 {

    public static void main(String[] args) {
        Connection con = null;
        ConnectionFactory cf = null;
        Queue serviceQueue = null;
        try {
            cf = new ActiveMQConnectionFactory("tcp://192.168.1.42:61616");
            con = cf.createConnection("amq", "amq");
            con.start();
            Session session = con.createSession(false,
Session.AUTO_ACKNOWLEDGE);
            serviceQueue = (Queue) session.createQueue("DemoService");
            MessageConsumer messageConsumer =
session.createConsumer(serviceQueue);
            ProxyListener messageServiceListener = new ProxyListener();
            messageConsumer.setMessageListener(messageServiceListener);
            while(true);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
--------------------------------
public class ProxyListener implements javax.jms.MessageListener{ ..........

-------------------------------

When I try to subcribe in ReceiveInNode2 then the below exception occurs

javax.jms.InvalidDestinationException: AMQ119017: Queue
jms.queue.DemoService does not exist....
Caused by: ActiveMQNonExistentQueueException[errorType=QUEUE_DOES_NOT_EXIST
message=AMQ119017: Queue jms.queue.DemoService does not exist] ....




--
View this message in context: http://activemq.2283324.n4.nabble.com/Artemis-Load-balance-setup-ActiveMQNonExistentQueueException-tp4715814p4715913.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message