Justin,

Good point.  That’s what I am wondering is why is it listening on an IPv6 
address.  I will check on that.

Thank you.

From: Justin Bertram <jbert...@apache.org>
Date: Monday, June 2, 2025 at 12:04 PM
To: users@activemq.apache.org <users@activemq.apache.org>
Subject: Re: 
org.apache.activemq.artemis.spi.core.protocol.RemotingConnection.getRemoteAddress()
 returns IPv6 loopback
I've not seen this specific behavior before. I'm not sure why it would do
that.

To be clear,
org.apache.activemq.artemis.spi.core.protocol.RemotingConnection#getRemoteAddress
is basically just a wrapper around io.netty.channel.Channel#remoteAddress
[1] so the exact behavior here will be determined by Netty. It may be worth
reaching out to the Netty community for insight.

Is the client connecting via IPv6? Is the relevant acceptor listening on an
IPv6 address?


Justin

[1]
https://github.com/netty/netty/blob/0503b50a32ebdb576e3064f67b01081665f0f15e/transport/src/main/java/io/netty/channel/Channel.java#L147

On Mon, Jun 2, 2025 at 10:26 AM William Crowell
<wcrow...@perforce.com.invalid> wrote:

> Is there any reason why the following code would return the IPv6 loopback
> address and not the actual physical IPv4 address of the client?
>
> import io.netty.handler.codec.mqtt.MqttMessage;
> import org.apache.activemq.artemis.core.protocol.mqtt.MQTTInterceptor;
> import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
>
> public class MyInterceptor implements MQTTInterceptor {
>     @Override
>     public boolean intercept(final MqttMessage mqttMessage, final
> RemotingConnection connection) {
>       System.out.println("RemotingConnection: " +
> connection.getRemoteAddress());
>       return true;
>    }
> }
>
> This prints out: RemotingConnection: [0:0:0:0:0:0:0:1]:46682
>
> Regards,
>
> William Crowell
>
>
> This e-mail may contain information that is privileged or confidential. If
> you are not the intended recipient, please delete the e-mail and any
> attachments and notify us immediately.
>
>


CAUTION: This email originated from outside of the organization. Do not click 
on links or open attachments unless you recognize the sender and know the 
content is safe.


This e-mail may contain information that is privileged or confidential. If you 
are not the intended recipient, please delete the e-mail and any attachments 
and notify us immediately.

Reply via email to