Decode Error while connecting to ksqldb server on Confluent Cloud

Hello, I am new to ksqldb. I am trying to connect to ksqldb server on confluent cloud using the java client.

But I keep getting the DecodeExceeption below.

“io.vertx.core.json.DecodeException: Failed to decode:Unexpected character (‘<’ (code 60)): expected a valid value (JSON String, Number, Array, Object or token ‘null’, ‘true’ or ‘false’)
at [Source: (io.netty.buffer.ByteBufInputStream); line: 1, column: 2]”

Here is the code my code.

<
public static void main(String args) throws InterruptedException, ExecutionException {

    BasicConfigurator.configure();
    ClientOptions options = ClientOptions.create()
            .setHost("pkc-l6wr6.europe-west2.gcp.confluent.cloud")
            .setPort(443)
            .setUseTls(true)
            .setUseAlpn(true)
            .setBasicAuthCredentials("#############", #########################");

    Client client = Client.create(options);
    
    List<TopicInfo> topicInfos = client.listTopics().get();
    topicInfos.forEach(System.out::println);

}
/>

Any help debugging this will be highly appreciated.

Hi, from the error message, it looks like there’s an < character which isn’t valid JSON, since this is the Java client maybe you can set logging to debug or trace and hopefully it will give you a bit more details. Is it a possibility, there aren’t any topics yet (just a guess).

HTH,
Bill

This topic was automatically closed after 30 days. New replies are no longer allowed.