How to backup FileStore and clean up SIB Queue in Websphere Application Server

How to backup FileStore and clean up SIB Queue in Websphere Application Server

was_queue_backup_and_cleanup

Issue

The SIB queues messages were piling up (in the _SYSTEM.Exception.Destination queue) due to messages that were not getting processed. The SystemOut.log were showing the below exceptions.

Exception

Exception: com.ibm.ws.sib.msgstore.PersistenceFullException: CWSIS1574E: The file store’s permanent store file is full..”

Resolution

Step1: Take a snapshot of the queue count from the admin console for reference purpose from the following path in admin console

Buses > NOYBBus > Messaging engines > VerticalCluster.000-NOYBBus > Queue points

Step2: Stop the messaging engine on the required Bus

Buses > NOYBBus > Messaging engines

Step3: Backup the File store

Take backup of the below flat files using standard filesystem tools. Please note DO NOT attempt backup the file store while the messaging engine is running. This might result in lost or corrupt data.

  • Log FIle
  • Permanent store File
  • Temporary store File

The location of these flat files on the server could be obtained from the following path in the admin console.

Buses>Bus-Name>Messaging engines>Messaging engine name> File store

Step4: Clean up the queues using the below script

# clears SIB queues for the specified bus on a running Websphere instance
if len(sys.argv) < 1:
        print 'Expected argument containing bus name'
        sys.exit(1)
busname = sys.argv[0]
queues = AdminControl.queryNames('WebSphere:type=SIBQueuePoint,SIBus='+busname+',*').splitlines()for queue in queues:
        queue_name = AdminControl.getAttribute(queue, 'identifier')
        #if queue_name.startswith('q'): # This avoids 'system' queues like dead letter queue. Could probably clear those too.
        print 'Clearing queue ' + queue_name

        AdminControl.invoke(queue, 'deleteAllQueuedMessages', 'false')

Step5: Make sure that the queue count is 0 on all the queues at the following path on admin console

Buses > NOYBBus > Messaging engines > VerticalCluster.000-NOYBBus > Queue points

NOTE: Here it is assumed that the messages are being store on the Flat file system (i.e File store) rather than Data Store.

Hope you enjoyed reading this article. Thank you..