jbertram commented on PR #4179:
URL: 
https://github.com/apache/activemq-artemis/pull/4179#issuecomment-1219867590

   Couple of things:
   
    - Ideally the broker would automatically detect the use of the proxy 
protocol by a client. We already do lots of automatic protocol detection so 
that a single `acceptor` can support multiple messaging protocols plus 
WebSockets and HTTP. See 
`org.apache.activemq.artemis.core.protocol.ProtocolHandler` for implementation 
details. Having a static configuration means that the `acceptor` could only be 
used by clients communicating via the proxy protocol (or not). This would 
increase configuration complexity and potentially lead to confusion for clients.
    - I don't see any code that actually makes use of the proxy protocol's 
additional information. Is Netty supposed to handle this transparently so that 
`io.netty.channel.Channel#remoteAddress` returns the client's actual address 
rather than the address of the proxy?
   
   > Is there any way to run the broker locally, so I can test the workflow 
with an HAProxy local instance (i.e. docker)?
   
   I'm not quite sure what you're asking here. The broker can be run locally 
standalone using the normal distribution available from the website. The broker 
can be embedded and run just as you're doing in the test code you pasted. The 
broker can also be run via Docker as described 
[here](https://github.com/apache/activemq-artemis/tree/main/artemis-docker).
   
   > Which kind of tests should I develop for this change?
   
   A basic sanity check for each messaging protocol would be a good place to 
start. Something that just sends and consumes a message. 
   
   Of course, you'd start first with manual testing. I'd recommend using your 
own instance of HAProxy with the `artemis consumer` and `artemis producer` 
commands.
   
   Ultimately, though, we need tests in the test-suite to validate the 
functionality for each release and to mitigate against regressions. However, 
this may be difficult as I don't see any kind of Java implementation for 
HAProxy which you could embed and use for testing. You may need to implement 
something of your own here to act like HAProxy using Netty and 
`io.netty.handler.codec.haproxy.HAProxyMessageEncoder`. 
   
   Hope that helps!


-- 
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]

Reply via email to