I am using 0.11.0 version ksqldb , while connecting ksldb through java client using domainname ( ex : dev.host) with port 80 I am getting below error , but with same url I am able connect through cli .
"java.util.concurrent.ExecutionException: io.confluent.ksql.api.client.exception.KsqlClientException: Received 400 response from server: This endpoint is only available when using HTTP2. Error code: 40004"
Please help me how to resolve this issue.
Thanks
public static String KSQLDB_SERVER_HOST ="sample.net";
public static int KSQLDB_SERVER_HOST_PORT = 80;
public static void main(String[] args) {
ClientOptions options = ClientOptions.create()
.setHost(KSQLDB_SERVER_HOST)
.setPort(KSQLDB_SERVER_HOST_PORT);
options.setVerifyHost(true);
System.out.println(" stream query started before ");
Client client = Client.create(options);
System.out.println(" stream query started after connection"+client);
// Send requests with the client by following the other examples
StreamedQueryResult streamedQueryResult = null;
try {
streamedQueryResult=client.streamQuery("select companyid from teststream emit changes limit 1;").get();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
// Block until a new row is available
// System.out.println(" query is completed "+streamedQueryResult.isComplete());
Row row = streamedQueryResult.poll();
while(row!=null) {
List<String> list = row.columnNames();
System.out.println(" columns " + list);
System.out.println("Received a row!");
System.out.println("Row: " + row.getValue("COMPANYID"));
row = streamedQueryResult.poll();
}
client.close();
// Terminate any open connections and close the clientclient.close();
}
}
--
You received this message because you are subscribed to a topic in the Google Groups "ksqldb-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ksql-users/8srNdOGj76Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ksql-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/ksql-users/9bf3c154-24d2-4e49-8d74-76c9b3dc3e7cn%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "ksqldb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ksql-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/ksql-users/29d8a25c-2ebc-40eb-b6ec-b0f25bb4f134n%40googlegroups.com.