Problem:
Product Name: AppServer
Product Version: 6.6
Product Component: TIBCO
Platform/OS Version: All
"tibemsadmin" tool can be used to perform the following functions:
- Compact - which compacts the sync/async messages db
 - Purge Topic/Queue when being full since there are no consumers/receivers
 - Create or destroy Topic/Queue
 - Pending messages count, total size of the messages.
 
However, at times, manual intervention is not possible in a production environment. Is there a way to code the administrative feature in an application?
Resolution:
1. Connect to the TIBCO server.
2. Use the TIBCO admin apis(TibjmsAdmin) and perform the above functions programmatically.
3. The following code snippet is an example of using the admin apis:
import com.tibco.tibjms.admin.*;
public class tibjmsServer
{
TibjmsAdmin admin = null;
public tibjmsServer() {
try {
//Create the admin connection to the TIBCO EMS server
admin = new TibjmsAdmin("tcp://localhost:7222","admin" , "");
admin.setAutoSave(true);
//Running compact
admin.compact(TibjmsAdmin.STORE_ASYNC, 3);
//purging queue Q1
admin.purgeQueue("Q1");
}
catch(TibjmsAdminException e) {
e.printStackTrace();
}
}
public static void main(String args[]) {
tibjmsServer t = new tibjmsServer();
}
}
Please refer the other administrative APIs in the Appserver installation folder <install_dir>/jms/tibco/ems/doc/html/api/Java/index.html.
#AppServer
#VisiBroker
#TIBCO
#JMS
#Security