Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » Java Paho: ClientId longer than 23 characters
Java Paho: ClientId longer than 23 characters [message #1777861] Tue, 05 December 2017 13:07 Go to next message
Carl Johnson is currently offline Carl JohnsonFriend
Messages: 1
Registered: December 2017
Junior Member

i started with Paho one week ago. First of all : good work!

I tried to generate a clientId via this method:


my exact line of code:

client = new MqttClient(ip, MqttClient.generateClientId());

this was my error:

Exception in thread "main" java.lang.IllegalArgumentException: ClientId longer than 23 characters
at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(
at org.eclipse.paho.client.mqttv3.MqttClient.<init>(
at org.eclipse.paho.client.mqttv3.MqttClient.<init>(
at MQTTMessenger.<init>(
at SmartFactory.<init>(
at SmartFactoryMain.main(

Did i do something wrong? Or why is the "generateClientId"-method producing a wrong clientId?

I hope i don't waste ur time.

Have a nice day.

Fine regards,

Re: Java Paho: ClientId longer than 23 characters [message #1778521 is a reply to message #1777861] Fri, 15 December 2017 15:57 Go to previous message
James Sutton is currently offline James SuttonFriend
Messages: 71
Registered: July 2015
Hi Carl,

What version of the Client are you using? The limit on 23 characters was removed in MQTT 3.1.1, and this check / error in particular was removed back in 2014 (

I'd suggest upgrading to the latest version of the Paho client, where the Client ID limit is 65535 characters.

The current version is 1.2.0 which can be found on Maven Central here:
Previous Topic:DexArchiveMergerException on adding paho dependencies to Android project
Next Topic:Python and PKCS11
Goto Forum:

Current Time: Thu Oct 22 19:00:42 GMT 2020

Powered by FUDForum. Page generated in 0.07878 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top