Dhairya-007 opened a new pull request, #29970:
URL: https://github.com/apache/camel/pull/29970
## Problem
The declared default and the field initialiser are different strings:
```java
@UriParam(label = "consumer,advanced", defaultValue = "Poison JMS message
due to ${exception.message}",
description = "If eagerLoadingOfProperties is enabled and the JMS
message payload (JMS body or JMS properties) is poison (cannot be read/mapped),"
+ " then set this text as the message body instead
so the message can be processed"
+ " (the cause of the poison are already stored as
exception on the Exchange)."
+ " This can be turned off by setting
eagerPoisonBody=false."
+ " See also the option eagerLoadingOfProperties.")
private String eagerPoisonBody = "Poison JMS message payload:
${exception.message}";
```
- declared: `Poison JMS message due to ${exception.message}`
- actual: `Poison JMS message payload: ${exception.message}`
The initialiser is the one that reaches the exchange.
`EndpointMessageListener` evaluates `eagerPoisonBody` as a simple expression
and sets the result as the body when the payload cannot be read:
```java
if (ObjectHelper.isNotEmpty(eagerPoisonBody) && eagerLoadingOfProperties) {
...
String text = eagerPoisonBody;
...
.createExpression(eagerPoisonBody).evaluate(exchange,
String.class);
```
So the body of a poison message always reads "Poison JMS message payload:
...", while the catalog, the component docs and the endpoint DSL javadoc all
say the default is "Poison JMS message due to ...". Anyone who took the
documented default and matched or filtered on that text - the natural thing to
do with a value whose whole purpose is to be recognised downstream - never
matched anything, with nothing to indicate why.
## Fix
Declare the string the code actually uses. No behaviour changes; only the
metadata and what is generated from it.
The same option is inherited by `camel-activemq`, `camel-activemq6` and
`camel-amqp`, so their generated catalogs carry the wrong default too and are
updated along with the JMS ones, plus the component and endpoint DSL builders.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]