简体   繁体   中英

JMS taking too long to process messages

An application has a JMS queue responsible for delivering audit logs. The application send logs to a JMS queue and this queue is consumed by a MDB.

However the messages sent are big XML files that vary from 20 MB to 100 MB. The problem is that the JMS queue take too long to consume the messages, leading to an OutOfMemory error.

What should I do to solve this problem?

This answer may of may not help jguilhermemv, just want to share an idea for those who can read this post, a work around for big messages. First thing is try not to send to big messages, Now we have two options ( But these require implementation changes, and can be done in starting or if system implementation changes are allowed in later stage ):

  1. Try to save the log in DB and send just log-ids in JMS msgs. ( Saving logs in DB is not recommended as size and time to save will again be a problem in later stage. )

  2. Save logs in form of files ( Save them at a common location ) and file names in DB and share those file name IDs via JMS. Consumer can then after consuming can read that log file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM