Why should I use timeout with tibemsadmin compact command?

Why should I use timeout with tibemsadmin compact command?

book

Article ID: KB0092618

calendar_today

Updated On:

Products Versions
TIBCO Enterprise Message Service -
Not Applicable -

Description

Resolution:
The command is run under tibemsadmin – an Admin Console for EMS server.

COMPACT  sync/ async &ltmax-time>

The &ltmax-time> is an optional field in pre EMS 5.0. If not specified, the compact command runs till the file is 100% compacted.

COMPACT command requires either sync or async to be specified so that it can compact synchronous or asynchronous file.

New incoming EMS requests on queue or topic will not be possible during compaction. This is because access to the datastore is halted temporarily.

All old clients connected to the EMS server will remain connected (though they will be unable to send/receive messages). Messages will not be lost, rather message delivery will be halted until the compaction process is complete.

All new clients trying to connect to the EMS server will not receive any error but will be unable to complete the connection creation call until the compact process completes.

Recommendation for use:

To recap. Operations to the EMS datastores will be "blocked" during the compact operation, so be aware of this if you automate the compact process.   If you compact during a low volume period, make sure the datastore does not have large volumes of undelivered messages. In pre EMS 5.0 make sure that you place a timeout (i.e. 60 seconds) on the compact command. It is  advisable to compact using small intervals of so that the EMS server is halted for small time duration. In EMS 5.0 and greater the timeout value is required. The tibemsadmin 5.0 tool will print a warning saying that messaging operations will be on hold for at most the compact timeout specified.


In order to execute the "compact" command periodically on your EMS server instance, you could consider the following 2 options:

1) Creating a script like the following ("compact.script"):

connect [server-url {admin|user_name} password]
compact sync [max_time]  

and then run this script periodically for example using a cron job on your OS with the following command:

tibjmsadmin -server emshost:port -ignore -script compact.script

Please be aware since compaction can be a lengthy operation, and it blocks other database operations, it is strongly recommended to specify a time limit when you issue the above command.

2) Coding a program that uses the "compact" function of the EMS Admin API.

Issue/Introduction

Why should I use timeout with tibemsadmin compact command?