-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullPointerException since 5.19.0 (Add support for Micrometer Observation) #1534
Comments
Thanks for the report. Since you understand the issue well, a pull request with a fix (and tests) would be appreciated. |
we will not guess what specifically your environment or client configuration looks like. We do not guess in this community. Please submit a PR and/or a set of steps to reproduce. |
I will submit a pull request next week. |
@assopt I pushed a fix. Can you tell us more about your environment? I'd be curious to know how the address can be null at this point. |
In that specific environment we initialize the connection from a server where no hostname resolution is available. So that server uses a socks proxy via its IP address to reach the rabbitmq server via its hostname. The hostname is then resolved by the socks proxy. We cannot use the IP address of the rabbitmq server directly as it may change in the future. |
OK, thanks for the context. Can you try the latest snapshot to make sure the issue is fixed in your environment? |
Works :-) Thank you! |
Describe the bug
The code at line 445 was added in 5.19.0 (Add support for Micrometer Observation).
Other code in the class AMQConnection is null safe. toString() for example uses the method getHostAddress() which explicitly handles the case of the address being null.
Reproduction steps
We know that the address is null because the hostname cannot be resolved. As we have a proxy in between there is no need to resolve the hostname in the first place.
Expected behavior
No NPE even if the hostname cannot be resolved to an address.
Use
getHostAddress()
instead ofthis._frameHandler.getAddress().getHostAddress()
.Additional context
Including 5.18.0 everything worked. With the update to a newer version as the only change on our side we get the NPE.
The text was updated successfully, but these errors were encountered: