You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Working Titus <wo...@gmail.com> on 2022/07/27 08:46:13 UTC

Support PROXY protocol for Acceptors

Hey guys!

I've just installed and configured an ActiveMQ Artemis 2.23.0 Cluster and
was looking to use HAProxy as a Load Balancer for the STOMP connections, in
order to avoid a client-side load balancing configuration.

I was successful in implementing it, however I was unable to set it up
using PROXY protocol an so all the client IP addresses in the Artemis Web
Console appear as the Load Balancer's IP address.

Is there any configuration I can add to the Acceptors so they work with
PROXY protocol or is it just not supported? And if so, would it be possible
to implement this support, or is it just something  not wanted/interesting?

Best regards,
João Santos

Re: Support PROXY protocol for Acceptors

Posted by Working Titus <wo...@gmail.com>.
Hey Justin,

You're right! Yesterday I went all in on the project and got to that same
class. I'm currently discovering and understanding how to add the HAProxy
decoder to the channel pipeline in order to get it to work! I've already
created an improvement (ARTEMIS-3915
<https://issues.apache.org/jira/browse/ARTEMIS-3915>) for this, so I'll add
more info there!

Once again, thank you very much for your help!

Kind Regards,
João Santos

On Tue, Aug 2, 2022 at 8:02 PM Justin Bertram <jb...@apache.org> wrote:

> I'm not a Netty expert by any means, but I would start in
> org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor. That's
> where most of the Netty pipeline is configured, and it's also where the
> main
> org.apache.activemq.artemis.core.protocol.ProtocolHandler.ProtocolDecoder
> is added.
>
>
> Justin
>
>
> On Sat, Jul 30, 2022 at 11:40 AM Working Titus <wo...@gmail.com>
> wrote:
>
> > Hey Justin,
> >
> > So yeah! I would be thrilled to contribute with this one myself, but the
> > project is quite big and I'm a bit unsure about where to start, could you
> > maybe give me some directions? Should I create a Jira issue at Artemis
> Jira
> > to follow up with the work?
> >
> > Greetings,
> > João Santos
> >
> > On Wed, Jul 27, 2022 at 9:11 PM Justin Bertram <jb...@apache.org>
> > wrote:
> >
> > > ActiveMQ Artemis doesn't support the PROXY protocol, but it looks
> > > interesting and I think it would be worth implementing. Is this
> something
> > > you'd want to contribute? I see that Netty already has support for this
> > [1]
> > > so most of the heavy lifting has already been done.
> > >
> > >
> > > Justin
> > >
> > > [1] https://github.com/netty/netty/tree/4.1/codec-haproxy
> > >
> > > On Wed, Jul 27, 2022 at 3:46 AM Working Titus <wo...@gmail.com>
> > > wrote:
> > >
> > > > Hey guys!
> > > >
> > > > I've just installed and configured an ActiveMQ Artemis 2.23.0 Cluster
> > and
> > > > was looking to use HAProxy as a Load Balancer for the STOMP
> > connections,
> > > in
> > > > order to avoid a client-side load balancing configuration.
> > > >
> > > > I was successful in implementing it, however I was unable to set it
> up
> > > > using PROXY protocol an so all the client IP addresses in the Artemis
> > Web
> > > > Console appear as the Load Balancer's IP address.
> > > >
> > > > Is there any configuration I can add to the Acceptors so they work
> with
> > > > PROXY protocol or is it just not supported? And if so, would it be
> > > possible
> > > > to implement this support, or is it just something  not
> > > wanted/interesting?
> > > >
> > > > Best regards,
> > > > João Santos
> > > >
> > >
> >
>

Re: Support PROXY protocol for Acceptors

Posted by Justin Bertram <jb...@apache.org>.
I'm not a Netty expert by any means, but I would start in
org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor. That's
where most of the Netty pipeline is configured, and it's also where the
main
org.apache.activemq.artemis.core.protocol.ProtocolHandler.ProtocolDecoder
is added.


Justin


On Sat, Jul 30, 2022 at 11:40 AM Working Titus <wo...@gmail.com>
wrote:

> Hey Justin,
>
> So yeah! I would be thrilled to contribute with this one myself, but the
> project is quite big and I'm a bit unsure about where to start, could you
> maybe give me some directions? Should I create a Jira issue at Artemis Jira
> to follow up with the work?
>
> Greetings,
> João Santos
>
> On Wed, Jul 27, 2022 at 9:11 PM Justin Bertram <jb...@apache.org>
> wrote:
>
> > ActiveMQ Artemis doesn't support the PROXY protocol, but it looks
> > interesting and I think it would be worth implementing. Is this something
> > you'd want to contribute? I see that Netty already has support for this
> [1]
> > so most of the heavy lifting has already been done.
> >
> >
> > Justin
> >
> > [1] https://github.com/netty/netty/tree/4.1/codec-haproxy
> >
> > On Wed, Jul 27, 2022 at 3:46 AM Working Titus <wo...@gmail.com>
> > wrote:
> >
> > > Hey guys!
> > >
> > > I've just installed and configured an ActiveMQ Artemis 2.23.0 Cluster
> and
> > > was looking to use HAProxy as a Load Balancer for the STOMP
> connections,
> > in
> > > order to avoid a client-side load balancing configuration.
> > >
> > > I was successful in implementing it, however I was unable to set it up
> > > using PROXY protocol an so all the client IP addresses in the Artemis
> Web
> > > Console appear as the Load Balancer's IP address.
> > >
> > > Is there any configuration I can add to the Acceptors so they work with
> > > PROXY protocol or is it just not supported? And if so, would it be
> > possible
> > > to implement this support, or is it just something  not
> > wanted/interesting?
> > >
> > > Best regards,
> > > João Santos
> > >
> >
>

Re: Support PROXY protocol for Acceptors

Posted by Justin Bertram <jb...@apache.org>.
I'm not a Netty expert by any means, but I would start in
org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor. That's
where most of the Netty pipeline is configured, and it's also where the
main
org.apache.activemq.artemis.core.protocol.ProtocolHandler.ProtocolDecoder
is added.


Justin


On Sat, Jul 30, 2022 at 11:40 AM Working Titus <wo...@gmail.com>
wrote:

> Hey Justin,
>
> So yeah! I would be thrilled to contribute with this one myself, but the
> project is quite big and I'm a bit unsure about where to start, could you
> maybe give me some directions? Should I create a Jira issue at Artemis Jira
> to follow up with the work?
>
> Greetings,
> João Santos
>
> On Wed, Jul 27, 2022 at 9:11 PM Justin Bertram <jb...@apache.org>
> wrote:
>
> > ActiveMQ Artemis doesn't support the PROXY protocol, but it looks
> > interesting and I think it would be worth implementing. Is this something
> > you'd want to contribute? I see that Netty already has support for this
> [1]
> > so most of the heavy lifting has already been done.
> >
> >
> > Justin
> >
> > [1] https://github.com/netty/netty/tree/4.1/codec-haproxy
> >
> > On Wed, Jul 27, 2022 at 3:46 AM Working Titus <wo...@gmail.com>
> > wrote:
> >
> > > Hey guys!
> > >
> > > I've just installed and configured an ActiveMQ Artemis 2.23.0 Cluster
> and
> > > was looking to use HAProxy as a Load Balancer for the STOMP
> connections,
> > in
> > > order to avoid a client-side load balancing configuration.
> > >
> > > I was successful in implementing it, however I was unable to set it up
> > > using PROXY protocol an so all the client IP addresses in the Artemis
> Web
> > > Console appear as the Load Balancer's IP address.
> > >
> > > Is there any configuration I can add to the Acceptors so they work with
> > > PROXY protocol or is it just not supported? And if so, would it be
> > possible
> > > to implement this support, or is it just something  not
> > wanted/interesting?
> > >
> > > Best regards,
> > > João Santos
> > >
> >
>

Re: Support PROXY protocol for Acceptors

Posted by Working Titus <wo...@gmail.com>.
Hey Justin,

So yeah! I would be thrilled to contribute with this one myself, but the
project is quite big and I'm a bit unsure about where to start, could you
maybe give me some directions? Should I create a Jira issue at Artemis Jira
to follow up with the work?

Greetings,
João Santos

On Wed, Jul 27, 2022 at 9:11 PM Justin Bertram <jb...@apache.org> wrote:

> ActiveMQ Artemis doesn't support the PROXY protocol, but it looks
> interesting and I think it would be worth implementing. Is this something
> you'd want to contribute? I see that Netty already has support for this [1]
> so most of the heavy lifting has already been done.
>
>
> Justin
>
> [1] https://github.com/netty/netty/tree/4.1/codec-haproxy
>
> On Wed, Jul 27, 2022 at 3:46 AM Working Titus <wo...@gmail.com>
> wrote:
>
> > Hey guys!
> >
> > I've just installed and configured an ActiveMQ Artemis 2.23.0 Cluster and
> > was looking to use HAProxy as a Load Balancer for the STOMP connections,
> in
> > order to avoid a client-side load balancing configuration.
> >
> > I was successful in implementing it, however I was unable to set it up
> > using PROXY protocol an so all the client IP addresses in the Artemis Web
> > Console appear as the Load Balancer's IP address.
> >
> > Is there any configuration I can add to the Acceptors so they work with
> > PROXY protocol or is it just not supported? And if so, would it be
> possible
> > to implement this support, or is it just something  not
> wanted/interesting?
> >
> > Best regards,
> > João Santos
> >
>

Re: Support PROXY protocol for Acceptors

Posted by Working Titus <wo...@gmail.com>.
Hey Justin,

So yeah! I would be thrilled to contribute with this one myself, but the
project is quite big and I'm a bit unsure about where to start, could you
maybe give me some directions? Should I create a Jira issue at Artemis Jira
to follow up with the work?

Greetings,
João Santos

On Wed, Jul 27, 2022 at 9:11 PM Justin Bertram <jb...@apache.org> wrote:

> ActiveMQ Artemis doesn't support the PROXY protocol, but it looks
> interesting and I think it would be worth implementing. Is this something
> you'd want to contribute? I see that Netty already has support for this [1]
> so most of the heavy lifting has already been done.
>
>
> Justin
>
> [1] https://github.com/netty/netty/tree/4.1/codec-haproxy
>
> On Wed, Jul 27, 2022 at 3:46 AM Working Titus <wo...@gmail.com>
> wrote:
>
> > Hey guys!
> >
> > I've just installed and configured an ActiveMQ Artemis 2.23.0 Cluster and
> > was looking to use HAProxy as a Load Balancer for the STOMP connections,
> in
> > order to avoid a client-side load balancing configuration.
> >
> > I was successful in implementing it, however I was unable to set it up
> > using PROXY protocol an so all the client IP addresses in the Artemis Web
> > Console appear as the Load Balancer's IP address.
> >
> > Is there any configuration I can add to the Acceptors so they work with
> > PROXY protocol or is it just not supported? And if so, would it be
> possible
> > to implement this support, or is it just something  not
> wanted/interesting?
> >
> > Best regards,
> > João Santos
> >
>

Re: Support PROXY protocol for Acceptors

Posted by Justin Bertram <jb...@apache.org>.
ActiveMQ Artemis doesn't support the PROXY protocol, but it looks
interesting and I think it would be worth implementing. Is this something
you'd want to contribute? I see that Netty already has support for this [1]
so most of the heavy lifting has already been done.


Justin

[1] https://github.com/netty/netty/tree/4.1/codec-haproxy

On Wed, Jul 27, 2022 at 3:46 AM Working Titus <wo...@gmail.com>
wrote:

> Hey guys!
>
> I've just installed and configured an ActiveMQ Artemis 2.23.0 Cluster and
> was looking to use HAProxy as a Load Balancer for the STOMP connections, in
> order to avoid a client-side load balancing configuration.
>
> I was successful in implementing it, however I was unable to set it up
> using PROXY protocol an so all the client IP addresses in the Artemis Web
> Console appear as the Load Balancer's IP address.
>
> Is there any configuration I can add to the Acceptors so they work with
> PROXY protocol or is it just not supported? And if so, would it be possible
> to implement this support, or is it just something  not wanted/interesting?
>
> Best regards,
> João Santos
>

Re: Support PROXY protocol for Acceptors

Posted by Justin Bertram <jb...@apache.org>.
ActiveMQ Artemis doesn't support the PROXY protocol, but it looks
interesting and I think it would be worth implementing. Is this something
you'd want to contribute? I see that Netty already has support for this [1]
so most of the heavy lifting has already been done.


Justin

[1] https://github.com/netty/netty/tree/4.1/codec-haproxy

On Wed, Jul 27, 2022 at 3:46 AM Working Titus <wo...@gmail.com>
wrote:

> Hey guys!
>
> I've just installed and configured an ActiveMQ Artemis 2.23.0 Cluster and
> was looking to use HAProxy as a Load Balancer for the STOMP connections, in
> order to avoid a client-side load balancing configuration.
>
> I was successful in implementing it, however I was unable to set it up
> using PROXY protocol an so all the client IP addresses in the Artemis Web
> Console appear as the Load Balancer's IP address.
>
> Is there any configuration I can add to the Acceptors so they work with
> PROXY protocol or is it just not supported? And if so, would it be possible
> to implement this support, or is it just something  not wanted/interesting?
>
> Best regards,
> João Santos
>