Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
ConcurrentModificationException at com.consol.citrus.message.DefaultMessage.toString() #302
While using Citrus (2.7.2) to mock multiple http services and using a a forked http-client, I am facing random exceptions of the following kind:
I created a demo project that (after running it a couple of times) duplicates the behavior.
It seems that the exception occurs when printing the headers of a
added a commit
Nov 13, 2017
Thanks for the sample project that made it easy to reproduce. My first thought was that default message toString() is not thread safe. Then I was convinced that the internal message header list object instance is the root cause of the problem.
Turned out that it is the Spring integration message channel that is internally used in server components. The channel has a debug logging feature that prints out the messages preSend and postSend. The postSend logging operation crashes when the consumer reads the message from the channel at the same time.
So it is related to debug logging enabled in logging framework and on the message channel. If you disable the debug logging on that channel the problem is fixed. This is also why I had hard times to reproduce as logging level is not always set to debug.
Also I changed the channel logging to disabled by default in Citrus 2.7.3. Up to then you can change the logging level for the message channel logging as follows: