[
https://issues.apache.org/jira/browse/ARTEMIS-3915?focusedWorklogId=982324&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-982324
]
ASF GitHub Bot logged work on ARTEMIS-3915:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 08/Sep/25 17:14
Start Date: 08/Sep/25 17:14
Worklog Time Spent: 10m
Work Description: gemmellr commented on code in PR #5908:
URL: https://github.com/apache/activemq-artemis/pull/5908#discussion_r2330860243
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/ProtocolHandler.java:
##########
@@ -184,7 +208,9 @@ public void channelRead(ChannelHandlerContext ctx, Object
msg) throws Exception
ctx.writeAndFlush(new DefaultFullHttpResponse(HTTP_1_1,
FORBIDDEN)).addListener(ChannelFutureListener.CLOSE);
}
} else {
- super.channelRead(ctx, msg);
+ // slice off the proxy-related bytes that have already been read
so other protocol handlers don't choke on them
+ super.channelRead(ctx, skipProxyBytes ? ((ByteBuf) msg).slice() :
msg);
+ skipProxyBytes = false;
Review Comment:
Yep I got that, I just wondered if there was some way to do that buffer
handling closer to the HAProxyMessage servicing, or maybe even inspect the
status of the decoder that produces it and so avoid the ProtocolHandler having
to consider it on every subsequent execution given it should never arise again.
Similarly with the other comment that it would be nice to avoid the instanceof,
especially when proxyProtocol support isnt even enabled.
Issue Time Tracking
-------------------
Worklog Id: (was: 982324)
Time Spent: 5h (was: 4h 50m)
> Support PROXY Protocol
> ----------------------
>
> Key: ARTEMIS-3915
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3915
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Components: Broker
> Reporter: João Santos
> Assignee: Justin Bertram
> Priority: Major
> Labels: pull-request-available
> Time Spent: 5h
> Remaining Estimate: 0h
>
> [HAProxy|http://www.haproxy.org/] is a widely known and used TCP Load
> Balancer and especially useful for an ActiveMQ Artemis clustered environment.
> Although possible to functionally implement with both products current
> features, Artemis does not support the PROXY protocol, which prevents it's
> broker nodes from inferring the real remote client IP address when behind an
> HAProxy instance.
> Since Netty sockets implementation already seems to support this protocol
> (discussed w/ [~jbertram] on DEV mailing list), it shouldn't be a big leap to
> adding support for the protocol on Artemis acceptors, thus improving the
> deployment of the use case at hand.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact