Hello everyone. I try to send messages from the Camel rout JMS component,
on some messages the error below occurs. Out of 50,000 messages, 4937
reached an average speed of 497 mes/sec. At the same time, with the same
settings, the classic ActiveMQ gives about 10,000 mes/sec

Artemis version 2.11.0. Camel version 2.20.2

Error

Error while routing: Message has put to DEAD.LETTER.QUEUE
 org.springframework.jms.UncategorizedJmsException: Uncategorized
exception occurred during JMS processing; nested exception is
javax.jms.JMSException: Failed to create session factory; nested
exception is ActiveMQNotConnectedException[errorType=NOT_CONNECTED
message=AMQ219007: Cannot connect to server(s). Tried with all
available servers.]
    at 
org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)
    at 
org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:169)
    at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:487)
    at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:516)
    at org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:440)
    at 
org.apache.camel.component.jms.JmsProducer.processInOnly(JmsProducer.java:394)
    at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:157)
    at 
org.apache.camel.processor.SendDynamicProcessor$1.doInAsyncProducer(SendDynamicProcessor.java:132)
    at 
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:445)
    at 
org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:127)
    at 
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
    at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
    at 
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97)
    at 
org.apache.camel.processor.WireTapProcessor$1.call(WireTapProcessor.java:158)
    at 
org.apache.camel.processor.WireTapProcessor$1.call(WireTapProcessor.java:153)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Suppressed: org.springframework.jms.UncategorizedJmsException:
Uncategorized exception occurred during JMS processing; nested
exception is javax.jms.JMSException: Failed to create session factory;
nested exception is
ActiveMQNotConnectedException[errorType=NOT_CONNECTED
message=AMQ219007: Cannot connect to server(s). Tried with all
available servers.]
        ... 19 more
        Suppressed: org.springframework.jms.UncategorizedJmsException:
Uncategorized exception occurred during JMS processing; nested
exception is javax.jms.JMSException: Failed to create session factory;
nested exception is
ActiveMQNotConnectedException[errorType=NOT_CONNECTED
message=AMQ219007: Cannot connect to server(s). Tried with all
available servers.]
            ... 19 more
            Suppressed:
org.springframework.jms.UncategorizedJmsException: Uncategorized
exception occurred during JMS processing; nested exception is
javax.jms.JMSException: Failed to create session factory; nested
exception is ActiveMQNotConnectedException[errorType=NOT_CONNECTED
message=AMQ219007: Cannot connect to server(s). Tried with all
available servers.]
                ... 19 more
            Caused by: javax.jms.JMSException: Failed to create session factory
                at
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:886)
                at
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:299)
                at
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:294)
                at
org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180)
                at
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)
                ... 16 more
            Caused by:
ActiveMQNotConnectedException[errorType=NOT_CONNECTED
message=AMQ219007: Cannot connect to server(s). Tried with all
available servers.]
                at
org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:799)
                at
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:884)
                ... 20 more
        Caused by: javax.jms.JMSException: Failed to create session factory
            at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:886)
            at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:299)
            at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:294)
            at 
org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180)
            at 
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)
            ... 16 more
        Caused by:
ActiveMQNotConnectedException[errorType=NOT_CONNECTED
message=AMQ219007: Cannot connect to server(s). Tried with all
available servers.]
            at 
org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:799)
            at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:884)
            ... 20 more
    Caused by: javax.jms.JMSException: Failed to create session factory
        at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:886)
        at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:299)
        at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:294)
        at 
org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180)
        at 
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)
        ... 16 more
    Caused by: ActiveMQNotConnectedException[errorType=NOT_CONNECTED
message=AMQ219007: Cannot connect to server(s). Tried with all
available servers.]
        at 
org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:799)
        at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:884)
        ... 20 more
Caused by: javax.jms.JMSException: Failed to create session factory
    at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:886)
    at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:299)
    at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:294)
    at 
org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180)
    at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)
    ... 16 more
Caused by: ActiveMQNotConnectedException[errorType=NOT_CONNECTED
message=AMQ219007: Cannot connect to server(s). Tried with all
available servers.]
    at 
org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:799)
    at 
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:884)
    ... 20 more

Camel route

<?xml version="1.0" encoding="UTF-8"?>
<beans factor:name="Send to Artemis" factor:status="true"
    xmlns="http://www.springframework.org/schema/beans";
    xmlns:context="http://www.springframework.org/schema/context";
    xmlns:cxf="http://camel.apache.org/schema/cxf";
    xmlns:factor="factor-schema"
    xmlns:jdbc="http://www.springframework.org/schema/jdbc";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="        http://camel.apache.org/schema/spring
      http://camel.apache.org/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/jdbc
http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
 http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf.xsd";>
    <camelContext errorHandlerRef="myDeadLetterErrorHandler"
        id="e726891b-7413-4428-9bf5-f6c85116c771"
xmlns="http://camel.apache.org/schema/spring";>
        <interceptFrom>
            <bean method="updateMDC" ref="logInterceptorService"/>
        </interceptFrom>
        <route factor:name="Send to Artemis"
id="route-4cd627f9-ba6d-43e3-ba24-4f61d8c1b69b">
            <from id="35ecd8c3-ea1e-48ee-8d1e-85815576242c"
uri="timer://init?delay=-1&amp;repeatCount=50000">
                <description>Timer</description>
            </from>
            <setBody factor:component="SetBodyEndpoint"
                factor:custom-name="Установить тело сообщения"

factor:guid="endpoint-34546317-7707-4c92-9d08-c388ea6cc390"
id="endpoint-34546317-7707-4c92-9d08-c388ea6cc390">
                <simple><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope";>
  <env:Header>
    <props:MessageInfo xmlns:props="urn:cbr-ru:msg:props:v1.3">
      <props:To>uic:5454</props:To>
      <props:From>uic:newuser</props:From>
      
<props:AppMessageID>guid:1134f9d42bc98c84caea7ee62c17881312</props:AppMessageID>
      <props:MessageID>guid:1429e234ae7016f981111361</props:MessageID>
      <props:MessageType>1</props:MessageType>
      <props:Priority>5</props:Priority>
      <props:CreateTime>2016-07-27T12:41:13Z</props:CreateTime>
      <props:LegacyTransportFileName>20191008 # pacs.008.001.08 #
AAAACNBJXXX # BBBBRUMMYYY #
123456789.xml</props:LegacyTransportFileName>
      <props:SendTime>2016-07-27T12:41:14Z</props:SendTime>
      <props:AckRequest>false</props:AckRequest>
    </props:MessageInfo>
    <props:DocInfo xmlns:props="urn:cbr-ru:msg:props:v1.3">
      <props:DocFormat>1</props:DocFormat>
      <props:DocType>ED311</props:DocType>
      <props:EDRefID EDNo="1" EDDate="2016-07-27" EDAuthor="1203709000" />
    </props:DocInfo>
  </env:Header>
  <env:Body>
    <sen:SigEnvelope xmlns:sen="urn:cbr-ru:dsig:env:v1.1">kk
    </sen:SigEnvelope>
  </env:Body>
</env:Envelope>]]></simple>
            </setBody>
            <setHeader factor:component="SetHeaderEndpoint"
                factor:custom-name="Установить заголовки"
                factor:guid="87ba2d3e-7eff-42cd-9efc-048764539364"
                headerName="JMSDeliveryMode"
id="87ba2d3e-7eff-42cd-9efc-048764539364">
                <constant>NON_PERSISTENT</constant>
            </setHeader>
            <wireTap id="18382f84-1f34-487e-a55a-a731e1ec9560"
uri="jms://TEST.FROM.CAMEL?connectionFactory=#RemoteArtemisMQ">
                <description>JMS</description>
            </wireTap>
        </route>
    </camelContext>

    <bean
        class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory"
        factor:bean-type="DEFAULT" id="RemoteArtemisMQ" name="RemoteArtemisMQ">
        <constructor-arg value="tcp://192.168.58.6:61619"/>
    </bean>
</beans>

Artemis config

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

   <core xmlns="urn:activemq:core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="urn:activemq:core ">

      <name>0.0.0.0</name>


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

      <!-- this could be ASYNCIO, MAPPED, NIO
           ASYNCIO: Linux Libaio
           MAPPED: mmap files
           NIO: Plain Java Files
       -->
      <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-datasync>true</journal-datasync>

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

      <journal-pool-files>10</journal-pool-files>

      <journal-device-block-size>4096</journal-device-block-size>

      <journal-file-size>10M</journal-file-size>

      <!--
       This value was determined through a calculation.
       Your system could perform 83.33 writes per millisecond
       on the current journal configuration.
       That translates as a sync write every 12000 nanoseconds.

       Note: If you specify 0 the system will perform writes directly
to the disk.
             We recommend this to be 0 if you are using
journalType=MAPPED and journal-datasync=false.
      -->
      <journal-buffer-timeout>12000</journal-buffer-timeout>


      <!--
        When using ASYNCIO, this will determine the writing queue
depth for libaio.
       -->
      <journal-max-io>4096</journal-max-io>
      <!--
        You can verify the network health of a particular NIC by
specifying the <network-check-NIC> element.
         <network-check-NIC>theNicName</network-check-NIC>
        -->

      <!--
        Use this to use an HTTP server to validate the network
         <network-check-URL-list>http://www.apache.org</network-check-URL-list>
-->

      <!-- <network-check-period>10000</network-check-period> -->
      <!-- <network-check-timeout>1000</network-check-timeout> -->

      <!-- this is a comma separated list, no spaces, just DNS or IPs
           it should accept IPV6

           Warning: Make sure you understand your network topology as
this is meant to validate if your network is valid.
                    Using IPs that could eventually disappear or be
partially visible may defeat the purpose.
                    You can use a list of multiple IPs, and if any
successful ping will make the server OK to continue running -->
      <!-- <network-check-list>10.0.0.1</network-check-list> -->

      <!-- use this to customize the ping used for ipv4 addresses -->
      <!-- <network-check-ping-command>ping -c 1 -t %d
%s</network-check-ping-command> -->

      <!-- use this to customize the ping used for ipv6 addresses -->
      <!-- <network-check-ping6-command>ping6 -c 1
%2$s</network-check-ping6-command> -->




      <!-- how often we are looking for how many bytes are being used
on the disk in ms -->
      <disk-scan-period>5000</disk-scan-period>

      <!-- once the disk hits this limit the system will block, or
close the connection in certain protocols
           that won't support flow control. -->
      <max-disk-usage>90</max-disk-usage>

      <!-- should the broker detect dead locks and other issues -->
      <critical-analyzer>true</critical-analyzer>

      <critical-analyzer-timeout>120000</critical-analyzer-timeout>

      <critical-analyzer-check-period>60000</critical-analyzer-check-period>

      <critical-analyzer-policy>HALT</critical-analyzer-policy>


      <page-sync-timeout>84000</page-sync-timeout>


            <!-- the system will enter into page mode once you hit this limit.
           This is an estimate in bytes of how much the messages are
using in memory

            The system will use half of the available memory (-Xmx) by
default for the global-max-size.
            You may specify a different value here if you need to
customize it to your needs.

            <global-max-size>100Mb</global-max-size>

      -->

      <acceptors>

         <!-- useEpoll means: it will use Netty epoll if you are on a
system (Linux) that supports it -->
         <!-- amqpCredits: The number of credits sent to AMQP producers -->
         <!-- amqpLowCredits: The server will send the # credits
specified at amqpCredits at this low mark -->
         <!-- amqpDuplicateDetection: If you are not using duplicate
detection, set this to false
                                      as duplicate detection requires
applicationProperties to be parsed on the server. -->

         <!-- Note: If an acceptor needs to be compatible with HornetQ
and/or Artemis 1.x clients add

"anycastPrefix=jms.queue.;multicastPrefix=jms.topic." to the acceptor
url.
                    See
https://issues.apache.org/jira/browse/ARTEMIS-1644 for more
information. -->

         <!-- Acceptor for every supported protocol -->
         <acceptor
name="artemis">tcp://0.0.0.0:61619?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true</acceptor>
      </acceptors>


      <security-settings>
         <security-setting match="#">
            <permission type="createNonDurableQueue" roles="amq"/>
            <permission type="deleteNonDurableQueue" roles="amq"/>
            <permission type="createDurableQueue" roles="amq"/>
            <permission type="deleteDurableQueue" roles="amq"/>
            <permission type="createAddress" roles="amq"/>
            <permission type="deleteAddress" roles="amq"/>
            <permission type="consume" roles="amq"/>
            <permission type="browse" roles="amq"/>
            <permission type="send" roles="amq"/>
            <!-- we need this otherwise ./artemis data imp wouldn't work -->
            <permission type="manage" roles="amq"/>
         </security-setting>
      </security-settings>

      <address-settings>
         <!-- if you define auto-create on certain queues, management
has to be auto-create -->
         <address-setting match="activemq.management#">
            <dead-letter-address>DLQ</dead-letter-address>
            <expiry-address>ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
            <!-- with -1 only the global-max-size is in use for limiting -->
            <max-size-bytes>-1</max-size-bytes>
            
<message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>PAGE</address-full-policy>
            <auto-create-queues>true</auto-create-queues>
            <auto-create-addresses>true</auto-create-addresses>
            <auto-create-jms-queues>true</auto-create-jms-queues>
            <auto-create-jms-topics>true</auto-create-jms-topics>
         </address-setting>
         <!--default for catch all-->
         <address-setting match="#">
            <dead-letter-address>DLQ</dead-letter-address>
            <expiry-address>ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
            <!-- with -1 only the global-max-size is in use for limiting -->
            <max-size-bytes>-1</max-size-bytes>
            
<message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>PAGE</address-full-policy>
            <auto-create-queues>true</auto-create-queues>
            <auto-create-addresses>true</auto-create-addresses>
            <auto-create-jms-queues>true</auto-create-jms-queues>
            <auto-create-jms-topics>true</auto-create-jms-topics>
         </address-setting>
      </address-settings>

      <addresses>
         <address name="DLQ">
            <anycast>
               <queue name="DLQ" />
            </anycast>
         </address>
         <address name="ExpiryQueue">
            <anycast>
               <queue name="ExpiryQueue" />
            </anycast>
         </address>

      </addresses>


      <!-- Uncomment the following if you want to use the Standard
LoggingActiveMQServerPlugin pluging to log in events
      <broker-plugins>
         <broker-plugin
class-name="org.apache.activemq.artemis.core.server.plugin.impl.LoggingActiveMQServerPlugin">
            <property key="LOG_ALL_EVENTS" value="true"/>
            <property key="LOG_CONNECTION_EVENTS" value="true"/>
            <property key="LOG_SESSION_EVENTS" value="true"/>
            <property key="LOG_CONSUMER_EVENTS" value="true"/>
            <property key="LOG_DELIVERING_EVENTS" value="true"/>
            <property key="LOG_SENDING_EVENTS" value="true"/>
            <property key="LOG_INTERNAL_EVENTS" value="true"/>
         </broker-plugin>
      </broker-plugins>
      -->

   </core>
</configuration>

I pointed out for Artemis *-Xmx6G*, but it didn’t affect anything, only
about 5-7% of the allocated memory is consumed

Please tell me why this error occurs and how to improve performance?

-- 
*With best regards, Lukyanov Mikhail*
*Моб: **+7-909-69-71-547*

Reply via email to