apache / apache/camel-quarkus

MllpTest.invalidMessage fails with Camel 3.11.5 in 2.2.x branch

Open
#3,442 1 comment 0 reactions 1 assignee Claimed by @JiriOndrusek View on GitHub
Dominant language
Java
Stars
302
Forks
232
Avg merge
1d 20h
Merged PRs (30d)
114

Description

This is what happens:

```
2022-01-07 12:25:38,165 ERROR [org.apa.cam.pro.err.DefaultErrorHandler] (TcpSocketConsumerRunnable[mllp://localhost:45733] - /127.0.0.1:43118 => /127.0.0.1:45733) Failed delivery for (MessageId: 8D301D6472BDDF3-0000000000000001 on ExchangeId: 8D301D6472BDDF3-0000000000000001). Exhausted after delivery attempt: 1 caught: java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because "org.apache.camel.component.mllp.MllpComponent.logPhi" is null

Message History (complete message history is disabled)
---------------------------------------------------------------------------------------------------------------------------------------
RouteId ProcessorId Processor Elapsed (ms)
[route1 ] [route1 ] [from[mllp://localhost:45733?validatePayload=true] ] [ 4]
...
[route1 ] [convertBodyTo1 ] [convertBodyTo[java.lang.String] ] [ 0]

Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
: java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because "org.apache.camel.component.mllp.MllpComponent.logPhi" is null
at org.apache.camel.component.mllp.MllpTcpServerConsumer.processMessage(MllpTcpServerConsumer.java:258)
at org.apache.camel.component.mllp.internal.TcpSocketConsumerRunnable.run(TcpSocketConsumerRunnable.java:142)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)

```

There is a couple of additional fixes in MLLP in Camel main branch that fix this, but they also substantially change the way the component is configured, so I think it would be less intrusive for the end users to workaround this in Camel Quarkus 2.2.1 by adding something like the following:

```
@ApplicationScoped
public class MllpComponentInitializer {
public void onComponentAdd(@Observes ComponentAddEvent event) {
if (event.getComponent() instanceof MllpComponent) {
MllpComponent.setLogPhi(MllpComponent.isLogPhi());
}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.