0
votes

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?

1
Which EJB container your application is using ? What is the Producer (Source) Transactions (messages) per second ? What is the Consumer (here your MDB) Transactions per second ? - developer
@VA31 the container is JBoss EAP 6 (HornetQ). Regarding the throughput per second I'm not sure, I gotta run a performance test to give you that info. - jguilhermemv
Did you think about increasing the number of instances of the MDB so that the application will be able to process more messages ? - developer

1 Answers

0
votes

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.