producer

Topic can't be found when producing messages: UNKNOWN_TOPIC_OR_PARTITION

痴心易碎 提交于 2019-12-03 12:03:06
I have a two-nodes kafka cluster (EC2 instances) where each node is used as a separate broker. When I run a producer on the leader instance with the following command: kafka-console-producer.sh --broker-list localhost:9092 --topic test I get the following errors. test message [2017-01-09 13:22:39,483] WARN Error while fetching metadata with correlation id 0 : {test=UNKNOWN_TOPIC_OR_PARTITION} (org.apache.kafka.clients.NetworkClient) [2017-01-09 13:22:39,562] WARN Error while fetching metadata with correlation id 1 : {test=UNKNOWN_TOPIC_OR_PARTITION} (org.apache.kafka.clients.NetworkClient)

Karaf - Kafka OSGI bundle - Producer issue

谁说我不能喝 提交于 2019-12-01 08:15:01
I am trying to create a simple bundle for Kafka producer in apache Karaf version 4.0.3 . Here is my Java code Properties props = new Properties(); props.put("bootstrap.servers", "localhost:9092"); props.put("acks", "all"); props.put("retries", 0); props.put("batch.size", 16384); props.put("linger.ms", 1); props.put("buffer.memory", 33554432); //props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); //props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); props.put("partitioner.class","org.apache.kafka.clients.producer.internals

Karaf - Kafka OSGI bundle - Producer issue

夙愿已清 提交于 2019-12-01 06:50:29
问题 I am trying to create a simple bundle for Kafka producer in apache Karaf version 4.0.3 . Here is my Java code Properties props = new Properties(); props.put("bootstrap.servers", "localhost:9092"); props.put("acks", "all"); props.put("retries", 0); props.put("batch.size", 16384); props.put("linger.ms", 1); props.put("buffer.memory", 33554432); //props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); //props.put("value.serializer", "org.apache.kafka.common

Unable to maintain order of producer tasks in java multithreading

喜你入骨 提交于 2019-11-30 18:24:47
问题 I am writing a multithreaded application where there a n producers who tries to add an element to the shared resource. I want to maintain the order in which producer produces the element in the shared resource. For example my shared resource is a SynchronizedQueue and P1, P2, P3, P4 are going to produce a new elements in the order p1, p2, p3, p4 and during that time P5 producer is adding its element to the queue, so P1, P2, P3, P4 will be waiting for the lock. Once P5 releases the lock any

What is the Spring DI equivalent of CDI's InjectionPoint?

╄→尐↘猪︶ㄣ 提交于 2019-11-30 12:08:15
I would like to create a Spring's bean producer method which is aware who invoked it, so I've started with the following code: @Configuration public class LoggerProvider { @Bean @Scope("prototype") public Logger produceLogger() { // get known WHAT bean/component invoked this producer Class<?> clazz = ... return LoggerFactory.getLogger(clazz); } } How can I get the information who wants to get the bean injected? I'm looking for some equivalent of CDI's InjectionPoint in Spring world. As far as I know, Spring does not have such a concept. Then only thing that is aware of the point that is

Leader Not Available Kafka in Console Producer

本小妞迷上赌 提交于 2019-11-30 05:54:53
问题 I am trying to use Kafka. All configurations are done properly but when i try to produce message from console I keep getting following error WARN Error while fetching metadata with correlation id 39 : {4-3-16-topic1=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient) kafka version: 2.11-0.9.0.0 回答1: It could be related to advertised.host.name setting in your server.properties . What could happen is that your producer is trying to find out who is the leader for a given partition,

Interact with kafka docker container from outside of docker host

醉酒当歌 提交于 2019-11-28 07:02:43
问题 I have built a kafka docker container and orchestrate it using docker-compose. Calling docker ps I get the following putput: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 5bde6f76246e hieutrtr/docker-kafka:0.0.1 "/start.sh" About an hour ago Up About an hour 7203/tcp, 0.0.0.0:32884->9092/tcp dockerkafka_kafka_3 be354f1b8cc0 hieutrtr/docker-ubuntu:devel "/usr/bin/supervisor About an hour ago Up About an hour 22/tcp producer1 50d3203af90e hieutrtr/docker-kafka:0.0.1 "/start.sh" About an

Leader Not Available Kafka in Console Producer

梦想与她 提交于 2019-11-27 16:57:28
I am trying to use Kafka. All configurations are done properly but when i try to produce message from console I keep getting following error WARN Error while fetching metadata with correlation id 39 : {4-3-16-topic1=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient) kafka version: 2.11-0.9.0.0 It could be related to advertised.host.name setting in your server.properties . What could happen is that your producer is trying to find out who is the leader for a given partition, figures out its advertised.host.name and advertised.port and tries to connect. If these settings are not

Fast and Best Producer/consumer queue technique BlockingCollection vs concurrent Queue [closed]

我是研究僧i 提交于 2019-11-27 10:10:33
Im using Generic.Queue in C# 3.0 and Monitor.Enter,wait,exit for wait before consuming the queue (wait for the element to be enqueued). Now im moving to C# 4. Can anyone suggest me which one is fast and best especially to avoid locks.. BlockingCollection vs concurrentQueue or any thing else... Note. I dont want to restrict my producer Thanks in advance.. BlockingCollection and ConcurrentQueue are there for precisely this reason. I doubt that you'll find anything better, or simpler to use. The parallel extensions team know their stuff :) Just a quick check on versions though - you're definitely

Fast and Best Producer/consumer queue technique BlockingCollection vs concurrent Queue [closed]

随声附和 提交于 2019-11-26 15:05:00
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . Im using Generic.Queue in C# 3.0 and Monitor.Enter,wait,exit for wait before consuming the queue (wait for the element to be enqueued). Now im moving to C# 4. Can anyone suggest me which one is fast and best especially to avoid locks.. BlockingCollection vs concurrentQueue or