0 Replies Latest reply on Feb 8, 2012 4:23 AM by yanny wang

    With Page used, restart HornetQ may have nullpointexception in initialization.

    yanny wang Newbie

      with HornetQ 2.2.5 final, standalone non cluster version, I create a queue (with queue id 8) and send 3000k messages to the queue. I then start to send and receive from this queue.

       

      I may kill the send&receiver (which is in one java program) in the middle and restart the program. it seems the page files are not removed since then while the consuming continues. there were totally 5186 messages can't be consumed while all the page files since the restart time remain.

       

      I then try to restart HornetQ to see if it could recover from it. in the hornetQ log, I fnd it has warning of can't find queue while reloading ACKNOWLEDGE_CURSOR and then get NullPointerException.

       

      the send, receiver and queue all use Core API and I send non-transaction persistent messages only.

       

      Any idea?

       

      It seems the paging function is not stable for enterprise usage. I have seen the same issue for several times.

      here is the log:

       

      Can't find queue 8 while reloading ACKNOWLEDGE_CURSOR

      2012-02-08 17:14:01,174 | ERROR | Failure in initialisation | org.hornetq.core.server.impl.HornetQServerImpl | main

      java.lang.NullPointerException

      at org.hornetq.core.paging.cursor.impl.PageSubscriptionImpl.getPageInfo(PageSubscriptionImpl.java:726)

      at org.hornetq.core.paging.cursor.impl.PageSubscriptionImpl.getPageInfo(PageSubscriptionImpl.java:712)

      at org.hornetq.core.paging.cursor.impl.PageSubscriptionImpl.processReload(PageSubscriptionImpl.java:655)

      at org.hornetq.core.paging.cursor.impl.PageCursorProviderImpl.processReload(PageCursorProviderImpl.java:241)

      at org.hornetq.core.paging.impl.PagingStoreImpl.processReload(PagingStoreImpl.java:355)

      at org.hornetq.core.paging.impl.PagingManagerImpl.processReload(PagingManagerImpl.java:250)

      at org.hornetq.core.persistence.impl.journal.JournalStorageManager.loadMessageJournal(JournalStorageManager.java:1229)

      at org.hornetq.core.server.impl.HornetQServerImpl.loadJournals(HornetQServerImpl.java:1619)

      at org.hornetq.core.server.impl.HornetQServerImpl.initialisePart2(HornetQServerImpl.java:1469)

      at org.hornetq.core.server.impl.HornetQServerImpl.access$100(HornetQServerImpl.java:132)

      at org.hornetq.core.server.impl.HornetQServerImpl$SharedStoreLiveActivation.run(HornetQServerImpl.java:356)

      at org.hornetq.core.server.impl.HornetQServerImpl.start(HornetQServerImpl.java:570)

      at org.hornetq.jms.server.impl.JMSServerManagerImpl.start(JMSServerManagerImpl.java:275)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

       

      Here is my config:

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

          <paging-directory>${data.dir:../data}/paging</paging-directory>

          <bindings-directory>${data.dir:../data}/bindings</bindings-directory>

          <journal-directory>${data.dir:../data}/journal</journal-directory>

          <journal-min-files>100</journal-min-files>

          <large-messages-directory>${data.dir:../data}/large-messages</large-messages-directory>
         
          <security-enabled>false</security-enabled>
      <journal-sync-non-transactional>false</journal-sync-non-transactional>

          <connectors>
              <!--connector name="netty">
                 <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
                 <param key="host"  value="${hornetq.remoting.netty.host:localhost}"/>
                 <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
              </connector-->

              <!--connector name="netty-throughput">
                  <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
                  <param key="host" value="${hornetq.remoting.netty.host:localhost}"/>
                  <param key="port" value="${hornetq.remoting.netty.batch.port:5455}"/>
                  <param key="batch-delay" value="50"/>
                  <param key="direct-deliver" value="true"/>
                  <param key="use-nio" value="false"/>
                  <param key="tcp-no-delay" value="true"/>
                  <param key="tcp-send-buffer-size" value="1048576"/>
                  <param key="tcp-receive-buffer-size" value="1048576"/>
              </connector-->
          </connectors>

          <acceptors>
              <!--acceptor name="netty">
                 <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
                 <param key="host"  value="${hornetq.remoting.netty.host:localhost}"/>
                 <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
              </acceptor-->

              <acceptor name="netty-throughput">
                  <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
                  <param key="host" value="${hornetq.remoting.netty.host:localhost}"/>
                  <param key="port" value="${hornetq.remoting.netty.batch.port:5455}"/>
                  <!--param key="batch-delay" value="50"/>
                  <param key="direct-deliver" value="true"/>
                  <param key="use-nio" value="false"/>
                  <param key="tcp-no-delay" value="true"/>
                  <param key="tcp-send-buffer-size" value="1048576"/>
                  <param key="tcp-receive-buffer-size" value="1048576"/-->
              </acceptor>
          </acceptors>

          <!--
          <security-settings>
             <security-setting match="#">
                <permission type="createNonDurableQueue" roles="guest"/>
                <permission type="deleteNonDurableQueue" roles="guest"/>
                <permission type="consume" roles="guest"/>
                <permission type="send" roles="guest"/>
             </security-setting>
          </security-settings>
          -->

          <queues>
              <queue name="DLQ">
                  <address>DLQ</address>
                  <durable>true</durable>
              </queue>
              <queue name="ExpiryQueue">
                  <address>ExpiryQueue</address>
                  <durable>true</durable>
              </queue>
          </queues>

          <address-settings>
              <!--default for catch all-->
              <address-setting match="#">
                  <dead-letter-address>DLQ</dead-letter-address>
                  <expiry-address>ExpiryQueue</expiry-address>
                  <max-delivery-attempts>7</max-delivery-attempts>
                  <redelivery-delay>1000</redelivery-delay>
                  <max-size-bytes>10485761</max-size-bytes>
                  <page-size-bytes>10485760</page-size-bytes>
                  <message-counter-history-day-limit>10</message-counter-history-day-limit>
                  <address-full-policy>PAGE</address-full-policy>
              </address-setting>
          </address-settings>

      </configuration>