[
https://issues.apache.org/jira/browse/CAMEL-26065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18132335#comment-18132335
]
Claus Ibsen commented on CAMEL-26065:
-------------------------------------
Merged on main by https://github.com/apache/camel/pull/28352 (merged as
0ed098c20211). Left open for the 4.22.x and 4.18.x backports listed in the fix
versions.
_Claude Code on behalf of davsclaus_
> camel-netty-http - key multiplex channel handlers by listener address
> ---------------------------------------------------------------------
>
> Key: CAMEL-26065
> URL: https://issues.apache.org/jira/browse/CAMEL-26065
> Project: Camel
> Issue Type: Bug
> Components: camel-netty-http
> Reporter: Andrea Cosentino
> Assignee: Andrea Cosentino
> Priority: Major
> Fix For: 4.18.6, 4.22.3, 4.24.0
>
>
> h3. Current behaviour
> {{NettyHttpComponent}} maintains server listening sockets
> ({{HttpServerBootstrapFactory}}) per host and port address, but keeps
> consumer multiplex channel handlers ({{HttpServerConsumerChannelFactory}}) in
> a map keyed solely by integer {{port}}.
> When multiple {{netty-http}} consumers share a port on different host
> addresses:
> * {{HttpServerInitializerFactory}} and {{HttpServerBootstrapFactory}} install
> the per-port multiplex channel handler into each server pipeline.
> * Inbound requests on any listening socket on that port are matched by
> {{HttpServerMultiplexChannelHandler}} against all consumers registered on
> that port across all host addresses.
> h3. Expected behaviour
> {{NettyHttpComponent}} keys multiplex channel handlers by the listener's
> address (host:port), ensuring that each listening socket dispatches requests
> only to consumers bound to its own address.
> h3. Change
> * {{NettyHttpComponent}}: Key {{multiplexChannelHandlers}} by listener
> address string (host:port). Add {{getMultiplexChannelHandler(String
> address)}} and retain {{getMultiplexChannelHandler(int port)}} as deprecated
> for backwards compatibility.
> * {{HttpServerInitializerFactory}}: Retrieve the multiplex channel handler
> using {{consumer.getConfiguration().getAddress()}} instead of port alone.
> * {{HttpServerBootstrapFactory}}: Initialize using the address-based
> multiplex channel handler.
> h3. Tests
> * {{NettyHttpDifferentHostSamePortTest}}: Verify that consumers configured on
> the same port across different host addresses only receive requests directed
> to their respective listening sockets, returning 404 for paths registered
> only on another host address.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)