0 Replies Latest reply on Mar 29, 2011 5:32 PM by Clebert Suconic

    Tool to Debug Journal Data

    Clebert Suconic Master

      We already had the ExportTool which is at a low level at the journal.

       

      I've just added another tool that will help a bit further, as it will print the entire content of the Journal, but with messages, and giving a bit more information.

       

       

      To run the tool, you have to do this:

       

       

      java -cp hornetq-core.jar:netty.jar org.hornetq.core.persistence.impl.journal.PrintData bindings-dir message-dir

       

       

      You will see an output like this:

       

       


      ********************************************
      B I N D I N G S  J O U R N A L
      ********************************************
      #JournalFileImpl: (hornetq-bindings-1.bindings id = 1, recordID = 1)
      operation@AddRecord,userRecordType=24;isUpdate=false;IDCounterEncoding [id=2147483647]
      operation@AddRecord,userRecordType=21;isUpdate=false;PersistentQueueBindingEncoding [id=0, name=sf.my-cluster.93ce39dd-4097-11e0-a624-78e7d1592f74, address=sf.my-cluster.93ce39dd-4097-11e0-a624-78e7d1592f74, filterString=null]
      operation@AddRecord,userRecordType=21;isUpdate=false;PersistentQueueBindingEncoding [id=14, name=jms.queue.QueueInError, address=jms.queue.QueueInError, filterString=null]
      operation@AddRecord,userRecordType=21;isUpdate=false;PersistentQueueBindingEncoding [id=18, name=jms.queue.QueueIn, address=jms.queue.QueueIn, filterString=null]
      operation@AddRecord,userRecordType=21;isUpdate=false;PersistentQueueBindingEncoding [id=24, name=jms.queue.QueueOut, address=jms.queue.QueueOut, filterString=null]
      operation@AddRecord,userRecordType=21;isUpdate=false;PersistentQueueBindingEncoding [id=28, name=jms.queue.QueueOutError, address=jms.queue.QueueOutError, filterString=null]
      operation@AddRecord,userRecordType=21;isUpdate=false;PersistentQueueBindingEncoding [id=30, name=jms.queue.ExpiryQueue, address=jms.queue.ExpiryQueue, filterString=null]
      operation@AddRecord,userRecordType=21;isUpdate=false;PersistentQueueBindingEncoding [id=32, name=jms.queue.DLQ, address=jms.queue.DLQ, filterString=null]
      #JournalFileImpl: (hornetq-bindings-2.bindings id = 2, recordID = 2)
      
      
      ### Surviving Records Summary ###
      userRecordType=24;isUpdate=false;IDCounterEncoding [id=2147483647]
      userRecordType=21;isUpdate=false;PersistentQueueBindingEncoding [id=0, name=sf.my-cluster.93ce39dd-4097-11e0-a624-78e7d1592f74, address=sf.my-cluster.93ce39dd-4097-11e0-a624-78e7d1592f74, filterString=null]
      userRecordType=21;isUpdate=false;PersistentQueueBindingEncoding [id=14, name=jms.queue.QueueInError, address=jms.queue.QueueInError, filterString=null]
      userRecordType=21;isUpdate=false;PersistentQueueBindingEncoding [id=18, name=jms.queue.QueueIn, address=jms.queue.QueueIn, filterString=null]
      userRecordType=21;isUpdate=false;PersistentQueueBindingEncoding [id=24, name=jms.queue.QueueOut, address=jms.queue.QueueOut, filterString=null]
      userRecordType=21;isUpdate=false;PersistentQueueBindingEncoding [id=28, name=jms.queue.QueueOutError, address=jms.queue.QueueOutError, filterString=null]
      userRecordType=21;isUpdate=false;PersistentQueueBindingEncoding [id=30, name=jms.queue.ExpiryQueue, address=jms.queue.ExpiryQueue, filterString=null]
      userRecordType=21;isUpdate=false;PersistentQueueBindingEncoding [id=32, name=jms.queue.DLQ, address=jms.queue.DLQ, filterString=null]
      ### Prepared TX ###
      
      

       

       

       

       

      One for the Bindings, and one for the MessageJournal

       

       

      Notice that you have the records per file (that will include deletes... etc), and the summary of the surviving records. That will be useful in case you are debugging a possible message loss (on the case I was investigating for instance it was a prepared TX pending).