[ 
https://issues.apache.org/jira/browse/ARTEMIS-3915?focusedWorklogId=982459&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-982459
 ]

ASF GitHub Bot logged work on ARTEMIS-3915:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Sep/25 16:29
            Start Date: 09/Sep/25 16:29
    Worklog Time Spent: 10m 
      Work Description: jbertram commented on code in PR #5908:
URL: https://github.com/apache/activemq-artemis/pull/5908#discussion_r2334176072


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java:
##########
@@ -145,6 +146,8 @@ public class NettyAcceptor extends AbstractAcceptor {
 
    private final boolean sslEnabled;
 
+   private final boolean proxyEnabled;

Review Comment:
   Done.



##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/ProtocolHandler.java:
##########
@@ -147,11 +156,26 @@ public void channelInactive(ChannelHandlerContext ctx) 
throws Exception {
             timeoutFuture.cancel(true);
             timeoutFuture = null;
          }
+         if (proxyAttributesSet) {
+            ctx.channel().attr(PROXY_PROTOCOL_SOURCE_ADDRESS).remove();
+            ctx.channel().attr(PROXY_PROTOCOL_SOURCE_PORT).remove();
+            ctx.channel().attr(PROXY_PROTOCOL_DESTINATION_ADDRESS).remove();
+            ctx.channel().attr(PROXY_PROTOCOL_DESTINATION_PORT).remove();
+            ctx.channel().attr(PROXY_PROTOCOL_VERSION).remove();
+         }
       }
 
       @Override
       public void channelRead(ChannelHandlerContext ctx, Object msg) throws 
Exception {
-         if (msg instanceof FullHttpRequest httpRequest) {
+         if (msg instanceof HAProxyMessage haProxyMessage) {

Review Comment:
   Done.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 982459)
    Time Spent: 5.5h  (was: 5h 20m)

> 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: 5.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


Reply via email to