Tibco stores messages in a data file or in database. I need to browse old messages posted to a topic or queue. Does EMS provide any API for searching old/consumed messages? Suppose I have a topic complexEvent.topic at time t1 a publisher publishes a message to complexEvent.topic, at time t2 a consumer consumes the message. Say after 2 hours from t2 I need to view all messages posted between t1 and t1+ 10 (minutes) to topic complexEvent.topic. How can I search old messages?
1 Answer
EMS does not store copies of messages by design : A MOM is not a DBMS, and a MOM should normally be optimized for performance.
For a SPECIFIC and PUNCTUAL need such as yours, I would simply create an EMS bridge (Similar to MQ Alias, see EMS doc) from the Destination(Topic,Queue) you want to log to a "DESTINATIONNAME.log" QUEUE. This way, the current code and destination are unaffected.
After that, you could use a Java QueueBrowser and MessageSelector to search for messages in your log queue. See this Oracle Documentation for details.
Don't forget to clean up the queue (You could also set up a message limit and overflow strategy).
If performances are critical, consider storing the logging queues on different EMS instances.
-
Hi GhislainCote, thanks for the answer. I am providing a TIBCO platform for the development teams. they can build topics and queues using automated installation script. I have no control to create bridge as I dont know when a new topic or queue will be created but need a dashboard to monitor the historical messages and search for a specific message. Even if we restart the EMS server, the monitor should find a message before restart.– SujoyCommented Mar 6, 2014 at 18:56
-
The only other possibility I see, beside having a completely separate log repository... Is to set the EMS stores as Databse instead of files. Then you should be able to construct a (web based?) dashboard by connecting directly to the database... no EMS needed. Good luck ! Commented Mar 14, 2014 at 13:46
-
Thanks! I found a mixed approach - reading the system destinations and logging all messages to a custom database table.– SujoyCommented Mar 14, 2014 at 17:41