Skip to content
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

Weird usage pattern required in multi-broker setup #1011

Open
jfontsaballs opened this issue Aug 23, 2023 · 0 comments
Open

Weird usage pattern required in multi-broker setup #1011

jfontsaballs opened this issue Aug 23, 2023 · 0 comments

Comments

@jfontsaballs
Copy link

✔️ Bug exists Release Version 1.2.5 (Master Branch)
❔ Bug exists in MQTTv3 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)
❔ Bug exists in MQTTv5 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)

I have a multi-broker setup, and I'm passing multiple URIs to the library via MqttConnectionOptions's setServerURIs in the connect method.

All MqttAsyncClient constructors require a single URI (not adequato to my use case), which is then ignored if setServerURIs is used. However this address is validated and an exception is throw if an empty string or a null is passed.

java.lang.IllegalArgumentException: missing scheme in broker URI: 
	at org.eclipse.paho.mqttv5.client.internal.NetworkModuleService.validateURI(NetworkModuleService.java:61)
	at org.eclipse.paho.mqttv5.client.MqttAsyncClient.<init>(MqttAsyncClient.java:573)
	at org.eclipse.paho.mqttv5.client.MqttAsyncClient.<init>(MqttAsyncClient.java:439)

As a workaround I can pass a fake address to the constructor, but it's ugly and confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant