Using [tibemsmonitor] "$sys.monitor.consumer.>" we can see "target_created" time in 'long (Uptime: HH:MM:SS)' of durables however, how to get the durable create time via the admin tool or API?
Issue/Introduction
how to get the durable create time via the admin tool or API?
Environment
ALL
Resolution
There is no direct command to find durable create time through TIBCO EMS Admin tool. But we can use Admin Java API to find durable creation time. Use getCreateTime() method of ConsumerInfo class of Admin API. We have created a sample EMS Java program(durableCreationTime) which will fetch the create time of durable(Note: durable should be up and running) in long format(durableCreationTime.java). Steps to run program: 1) Copy the program in TIBCO_ROOT\samples\java folder 2) Set classpath by running setup.bat file. If you get any errors related to the jar files missing, please check the setup.bat file and set classpath accordingly. 3) Compile java program using following command: javac durableCreationTime.java 4) After successful compilation of program run following command to get durable creation time. java durableCreationTime -server <server_url> -user <username> -password <password> -durable <durable_name> Example: java -server tcp://localhost:7222 -user admin -password admin -durable bw:Test2 Output: i) if durable is running, we get following output(here durable 'bw:Test2' is running): C:\tibco\ems\8.3\samples\java>java durableCreationTime -server tcp://7222 -user admin -password admin -durable bw:Test2 Durable bw:Test2 create time:1505891455102
ii) if durable is not running(offline), we get following output(here durable 'bw:Test1' is not running): C:\tibco\ems\8.3\samples\java>java durableCreationTime -server tcp://7222 -user admin -password admin -durable bw:Test1 Durable bw:Test1 is offline or not present
The time in long format can be converted into date format by writing your own program or using following site: https://www.epochconverter.com/