I recently upgraded my spring boot app from java 11 to java 17 along with other dependency jars –
enter image description here
App uses spring integration to consume messages from a JMS queue and then process it with other downstream systems.
<!-- Connects to queue to fetch message -->
<int-jms:message-driven-channel-adapter id="demoRequestChannelAdapter"
destination="demoRequestQueue"
channel="demo-request-unmrashal-channel"
error-channel="errorChannel"
connection-factory="demoConnectionFactory"
concurrent-consumers="${concurrentConsumers}"
max-concurrent-consumers="${maxConcurrentConsumers}" />
After deploying the upgraded app to production, started seeing below error –
[demoRequestChannelAdapter.container-1] WARN o.s.j.l.DefaultMessageListenerContainer - Execution of JMS message listener failed, and no ErrorHandler has been set.
org.springframework.messaging.MessageHandlingException: error occurred in message handler [bean 'org.springframework.integration.handler.LoggingHandler#0' for component 'errorloggerChannel.adapter']
at org.springframework.integration.support.utils.IntegrationUtils.wrapInHandlingExceptionIfNecessary(IntegrationUtils.java:191)
Caused by: org.springframework.expression.spel.**SpelEvaluationException**: **EL1078E: Concatenated string is too long, exceeding the threshold of '100,000' characters**
at org.springframework.expression.spel.ast.OpPlus.checkStringLength(OpPlus.java:158)
From the error it seems, spring integration is not able to take message larger the 100k characters length, app was able to consume these size messages before version upgrade.
I did try to find out this limit length and looks like it is hard coded in spring –
https://github.com/mdeinum/spring-framework/blob/7a43151dea15d613b26348fe9920546a0e3ff367/spring-expression/src/main/java/org/springframework/expression/spel/ast/OpPlus.java#L158
Tried to set custom limit as well via spring proprty, but app didn’t pick this –
export JAVA_OPTS="$JAVA_OPTS -Dspring.expression.spel.concatenationLimit=200000"
Does anyone know if there is any other way to fix this error and avoid rollback of app to java 11 and older version of spring?