You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "merlimat (via GitHub)" <gi...@apache.org> on 2026/05/08 00:06:17 UTC
[PR] [fix][client] PIP-468: V5 client validates serviceUrl scheme [pulsar]
merlimat opened a new pull request, #25720:
URL: https://github.com/apache/pulsar/pull/25720
## Summary
The v5 client only speaks the broker binary protocol; passing the admin/web service URL (`http://` or `https://`) used to silently accept the value and then fail far downstream with a cryptic connection error. This PR validates the URL at configure-time and fails fast with a message that points to the right URL.
- `PulsarClientBuilder.serviceUrl()` and `ConnectionPolicy.proxyServiceUrl` must use `pulsar://` or `pulsar+ssl://`. Anything else throws `IllegalArgumentException` at the setter.
- The error message for `http://` / `https://` specifically calls out the admin-URL confusion and hints at the broker port (6650 / 6651).
- API javadoc updated to document the contract and the `@throws`.
## Test plan
- [x] New `PulsarClientBuilderV5Test` covers:
- Accepted forms: `pulsar://host:port`, `pulsar+ssl://host:port`, multi-host comma list (`pulsar://h1:p,h2:p,h3:p`)
- Rejected schemes: `http://` (with admin-URL guidance + port hint), `https://` (with TLS-broker-scheme hint), `ws://`, null, blank
- `ConnectionPolicy.proxyServiceUrl` is validated too
- [x] All `pulsar-client-v5` unit tests pass
- [x] Checkstyle clean
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] PIP-468: V5 client validates serviceUrl scheme [pulsar]
Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat merged PR #25720:
URL: https://github.com/apache/pulsar/pull/25720
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org