It's strange you do not see the attachment as it is visible in my outbox.

I did debug camel code in different version using my test case (copied below) 
and it appears it come from a change of default setting for 
allowUseOriginalMessage in Camel context.


In release note 2.18.0 I see :

"Optimize Camel to only enable AllowUseOriginalMessage if in use by error 
handler or OnCompletion<http://camel.apache.org/oncompletion.html>. End user 
who manually access the original message using the Java API must configure 
AllowUseOriginalMessage=true."


It appears an other case requiring to set this to true is the case of 
transferExchange=true as the code use to reconstruct the jms message is called 
before adding the Exchange to InflightRepository only if set to true.


Is a JIRA still required (I am not sure if the JMS case is cover by "End user 
who manually access the original message using the Java API must configure 
AllowUseOriginalMessage=true" or not.


Regards,

Bastien Meert

________________________________
Bastien Meert
Senior software engineer
Email : bastien.me...@mainsysgroup.com
Phone : +3210801120
Mobile : +32472702422

  <http://www.mainsysgroup.com/>  
[cid:logo2017_255_d2e2177c-199f-4081-ab38-122e21e1580f.jpg]

 www.mainsysgroup.com<http://www.mainsysgroup.com>
        [cid:line_84a61260-257c-4e2b-8224-4cb01bfd9911.jpg]

Head Office
Bastion Tower
Place du Champ de Mars 5 b21 Marsveldplein
B-1050 Bruxelles / Brussel
Phone. : +32 2 733 83 87
Enterprise N° : BE 0456.540.594


P Please consider the environment before printing this email


________________________________
De : Bastien Meert
Envoyé : vendredi 5 avril 2019 16:33:13
À : users@camel.apache.org
Objet : Issue : Camel not clearing inflight repository.


Dear all,


We encounter a problem of java heap space using jms inOut and 
transferExchange=true option.

The origin of the memory leak is the InflightRepository in camel context to 
never dispose of any messages.


It occurs on consumer side with the following logic :

1. A message is receive through JMS, camel create an Exchange instance and add 
it to the context's inflightRepository.

2. The exchange received over JMS is parsed and used to set all the exchange 
value, including the exchangeId used as a key in inflightRepository. 
Unfortunately the inflightRepository key is not updated

3. When the route has finish its job it tries to dispose the message (probably 
using remove(Exchange) methods). But as the exchangeId in the Exchange is not 
the same as key store into InflightRepository, it is not removed.

4. After some time of execution (can be minutes or days regarding volume of 
data exchanged over JMS) the InflightRepository as eat all the heap memory 
space and it ends into a heap space error.


I created a small test case (in attachement) based on 
JmsInOutTransferExchangeTest from Jms Component on Github.
It passed successfully on 2.17.7 (version not failing we use in some of our 
apps), but fail with 2.21.x (version use in the new app).


Regards,

Bastien Meert

________________________________
Bastien Meert
Senior software engineer
Email : bastien.me...@mainsysgroup.com
Phone : +3210801120
Mobile : +32472702422

  <http://www.mainsysgroup.com/>  
[cid:logo2017_255_d2e2177c-199f-4081-ab38-122e21e1580f.jpg]

 www.mainsysgroup.com<http://www.mainsysgroup.com>
        [cid:line_84a61260-257c-4e2b-8224-4cb01bfd9911.jpg]

Head Office
Bastion Tower
Place du Champ de Mars 5 b21 Marsveldplein
B-1050 Bruxelles / Brussel
Phone. : +32 2 733 83 87
Enterprise N° : BE 0456.540.594


P Please consider the environment before printing this email


________________________________
This e-mail and its attachments may be confidential and are intended solely for 
the use of the individual to whom it is addressed. Any views or opinions 
expressed are solely those of the author and do not necessarily represent those 
of Mainsys. If you are not the intended recipient of this e-mail and its 
attachments, you must take no action based upon them, nor must you copy or show 
them to anyone. Please contact the sender if you believe you have received this 
e-mail in error.

Reply via email to