I am getting out of memory exeception with the JMS. I am using wildfly server and in standalone-full.xml of this server I am configuring the JMS queues. I am running one servlet application on wildfly server and from front end I am uploading one xml file. This is input xml file once received in servlet controller I am converting it to xmlString (string) and sending this string to destination queue. Once this string message appears on queue it will be listened by one JMS listener which I have configured (having onMessage method).
From this listener's onMessage method I am calling one function from my code with this xmlString as parameter. In that called function I am further reading xml content in my application code and performing few calculations as per applilcation requirement. Finally I am generating few xml files (26 xml files) after calculation is done. Then I am zipping these files in one zipped folder and I am converting this zipped file into byte array and sending this byte array content as byteMessage back to client end. And there I am again converting back the byteMessage to byte array then byteArray to zip file and again I am extracting this zip file on client's system.
So below is the basic flow sequence of my application:
created 26 XML Files in one folder during application calculations ->covert to Zip (Cpmpression) at server-> Convert zip to ByteArray -> convert byteArray to ByteMessage -> Send ByteMessage Over Queue ->
Receive ByteMessage -> Convert ByteMessage to Zip -> Decompress the zip file to have output files at client
When I run this servlet the above flow I am able to run 2 times successfully. But when I execute it for 3rd time I get below exception on wildfly server console:
Message Reference[70866969224]:NON-
RELIABLE:LargeServerMessage[messageID=70866969224,priority=4,expiration=[null], durable=false, address=jms.queue.MDBQueueRequest,properties=Typ
edProperties[_HQ_LARGE_SIZE=81007,__HQ_CID=5187e412-e1f7-11e5-8c47-db91fee4705c,_HQ_LARGE_COMPRESSED=true]]@2036392775
has reached maximum delivery attempts, sending it to Dead Letter Address jms.queue.DLQ from jms.queue.MDBQueueRequest
java.lang.OutOfMemoryError: GC overhead limit exceeded