Claus Ibsen created CAMEL-27926:
-----------------------------------
Summary: camel-atmosphere-websocket: NullPointerException when a
connection key has no open connection and the endpoint has no consumer
Key: CAMEL-27926
URL: https://issues.apache.org/jira/browse/CAMEL-27926
Project: Camel
Issue Type: Bug
Components: camel-atmosphere-websocket
Reporter: Claus Ibsen
Fix For: 4.25.0
Found while improving the option descriptions of camel-atmosphere-websocket for
CAMEL-23832 (pull request https://github.com/apache/camel/pull/31180).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. NullPointerException for an unknown connection key
{{WebsocketProducer.messageDistributor}} calls
getEndpoint().getWebsocketConsumer().sendNotDeliveredMessage(...). The consumer
is only set on the endpoint instance that created it, so with a producer URI
that differs from the consumer URI in its options (or no consumer in the
context), a connection key that matches no open connection fails the exchange
with a NullPointerException. The connection store is shared (keyed by the URI
before ?), the consumer reference is not.
Proposed change: keep the consumer per service path in WebsocketComponent next
to the stores; log and skip when there is none.
h4. 2. Smaller issues
The constant SEND_TO_ALL (CamelAtmosphereWebsocketSendToAll) is never read.
Many inherited camel-servlet options (chunked, transferException,
muteException, httpMethodRestrict, mapHttpMessage*, ...) have no effect, as
CamelWebSocketServlet hands the request to Atmosphere; they could be excluded.
Doc page typo "atmopshere-websocket".
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)