kafka-rest

Is there a way to produce Kafka messages with headers using Kafka Confluent REST API?

拜拜、爱过 提交于 2020-08-19 10:24:58
问题 I'm trying to send messages to Kafka with some custom headers, but I could't find a way to do it. According to the documatation, The POST /topics/(string: topic_name) API does not have a way to attach custom headers to messages. Does anyone know a way to send Kafka messages with custom headers through the confluent Kafka REST API? Here is my sample request body I sent to the REST proxy POST /topics/stream.mycustomtopic { "records": [{ "value": "{\"myFirstKey\":\"myFirstValue\"}" }] } 回答1: You

Is there a way to produce Kafka messages with headers using Kafka Confluent REST API?

落花浮王杯 提交于 2020-08-19 10:24:36
问题 I'm trying to send messages to Kafka with some custom headers, but I could't find a way to do it. According to the documatation, The POST /topics/(string: topic_name) API does not have a way to attach custom headers to messages. Does anyone know a way to send Kafka messages with custom headers through the confluent Kafka REST API? Here is my sample request body I sent to the REST proxy POST /topics/stream.mycustomtopic { "records": [{ "value": "{\"myFirstKey\":\"myFirstValue\"}" }] } 回答1: You

Could I create a topic in Kafka via API?

馋奶兔 提交于 2020-07-23 06:38:17
问题 I'm trying to find information about the topic creation in Kafka via API, because I need to automate some tasks, It would be great if someone knows if it's possible, I was reading here: https://docs.confluent.io/current/kafka-rest/api.html#crest-api-v3 But it didn't work for me. If I try to do GET in /v3/clusters/ --> returns code 404 回答1: I'm answering my own question. I post here what I found, that rest endpoint is useful only in case you have configured kafka rest proxy, if not, try to use

Could I create a topic in Kafka via API?

孤街醉人 提交于 2020-07-23 06:37:19
问题 I'm trying to find information about the topic creation in Kafka via API, because I need to automate some tasks, It would be great if someone knows if it's possible, I was reading here: https://docs.confluent.io/current/kafka-rest/api.html#crest-api-v3 But it didn't work for me. If I try to do GET in /v3/clusters/ --> returns code 404 回答1: I'm answering my own question. I post here what I found, that rest endpoint is useful only in case you have configured kafka rest proxy, if not, try to use

Could I create a topic in Kafka via API?

牧云@^-^@ 提交于 2020-07-23 06:35:55
问题 I'm trying to find information about the topic creation in Kafka via API, because I need to automate some tasks, It would be great if someone knows if it's possible, I was reading here: https://docs.confluent.io/current/kafka-rest/api.html#crest-api-v3 But it didn't work for me. If I try to do GET in /v3/clusters/ --> returns code 404 回答1: I'm answering my own question. I post here what I found, that rest endpoint is useful only in case you have configured kafka rest proxy, if not, try to use

Kafka producing message key as STRING even though the REST program has INT?

橙三吉。 提交于 2020-06-17 14:20:28
问题 I am using following program to produce records in kafka: import java.io.IOException; import java.security.SecureRandom; public class SensorStatusProducer { private final static String TOPIC = "SENSOR_STATUS_DETAILS"; private final static String PRODUCER_URI = "http://xxx.xxx.xxx.xxx:8082/topics/" + TOPIC; private final static SecureRandom randomNumber = new SecureRandom(); private final static SensorDetails sensorDetails = new SensorDetails(); public static void main(String[] args) { int[]

Confluent's Kafka REST Proxy vs Kafka Client

萝らか妹 提交于 2019-12-21 23:32:14
问题 I am curious about the advantages and disadvantages of Confluent's Kafka REST Proxy and the producer/consumer implemented with the kafka official client library. i know that Confluent's Kafka REST Proxy is used for administrative tasks and for languages ​​not supported by the kafka client. So, what are the advantages of the kafka client? 回答1: One advantage of a native client would be raw performance via direct TCP to the brokers rather than round trip HTTP serialization + JVM serialization

Caused by: java.lang.ClassNotFoundException: io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor

流过昼夜 提交于 2019-12-11 15:42:53
问题 Trying to publish message to kafka topic using rest proxy by Confluent platform using this command and responds with an error as mentioned below Request: $ curl -X POST -H "Content-Type: application/vnd.kafka.avro.v2+json" \ -H "Accept: application/vnd.kafka.v2+json" \ --data '{"value_schema": "{\"type\": \"record\", \"name\": \"User\", \"fields\": [{\"name\": \"name\", \"type\": \"string\"}]}", "records": [{"value": {"name": "test name"}}]}' \ "http://${RESTPROXY_HOST}:8082/topics/${TOPIC}"

JSONParseException reading data using Kafka rest API

流过昼夜 提交于 2019-12-11 08:55:38
问题 KAFKA TOPIC (test3) $ kafka-console-consumer --bootstrap-server broker:9092 --topic test3 --from-beginning "Can we write to a topic that does not exist?" "Can we write to a topic that does not exist?" {"foo":"bar"} ["foo","bar"] confluent confluent confluent kafka logs 0 0 Consumer (kafka-rest API on localhost:8082 ) Create a consumer POST request to http://localhost:8082/consumers/rested Request Body: { "format": "json", "auto.offset.reset": "earliest", "auto.commit.enable": "false" }

What are the benefits of the Kafka REST Proxy API?

可紊 提交于 2019-12-08 04:51:10
问题 I do not know the advantages of the Kafka REST Proxy API. It's a REST API, so I know it's handy for administration. Why do people use the Kafka REST Proxy API? Is it burdensome to add a Maven dependency on a producer or a consumer? Also, I know that the kafka client has better performance. 回答1: You wouldn't use it for performance Administration - You can make a single ACL for only REST Proxy communications Integrate with non-JVM languages that have no Kafka libraries. For example, client side