tabish121 commented on code in PR #5908:
URL: https://github.com/apache/activemq-artemis/pull/5908#discussion_r2376787102
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java:
##########
@@ -145,6 +147,12 @@ public class NettyAcceptor extends AbstractAcceptor {
private final boolean sslEnabled;
+ private final boolean proxyProtocolEnabled;
+
+ private static final HAProxyMessageEnforcer proxyProtocolRequired = new
HAProxyMessageEnforcer(true);
Review Comment:
I'd have put these into HAProxyMessageEnforcer similar to how
HAProxyMessageEncoder has an INSTANCE static just to tie together various bits
into one place. Something like HAProxyMessageEnforcer.PROXY_PROTOCOL_REQUIRED
and HAProxyMessageEnforcer.PROXY_PROTOCOL_REJECTED
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java:
##########
@@ -472,6 +482,14 @@ public synchronized void start() throws Exception {
@Override
public void initChannel(Channel channel) throws Exception {
ChannelPipeline pipeline = channel.pipeline();
+ if (proxyProtocolEnabled) {
Review Comment:
I think you can squash these into a single if else
```
if (proxyProtocolEnabled) {
pipeline.addLast(proxyProtocolRequired, new HAProxyMessageDecoder(), new
HAProxyMessageHandler());
} else {
pipeline.addLast(noProxyProtocolRequired);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact