Skip to content
Advertisement

Tag: spring-kafka

Use batch mode for dynamic listener

I am using a dynamic message listener. An example is shown below. I want to convert this to a batch listener (consume multiple messages at once). Is there a way to convert this, so that the listener consumes a list of consumer records? I am using spring-kafka with spring-boot. Thanks in advance Answer Implement BatchAcknowledgingConsumerAwareMessageListener instead.

Spring kstreams cannot get processor to work – The class ‘[B’ is not in the trusted packages

Full code: https://github.com/BenedictWHD/kstreams-example So I have a producer (data-ingest), processor (external-message-processor), and consumer (internal-message-processor (This will become a processor later once I get things working, so apologies for the naming at the moment, but it is a consumer)). The data-ingest works from what I can tell as it sends messages to the topic external_messages. The external-message-processor attempts to read from

Strategy to choose when doing Serialization and Deserialization using spring-kafka library

I need to Serialize or Deserialize any type of Java Object may be Integer/ String or <T> or User or Account in my project. There might be more than 1 type I am not sure which one to use while configuring a Kafka Producer and Consumer. There are JsonSerializer and JsonDeserializer and StringSerializer/DESer and many more types. I have read

How to handle Kafka container lifecycle using spring kafka in Kubernetes multipod deployment

I am using Spring kafka implementation and I need to start and stop my kafka consumer through an REST API. For that i am using KafkaListenerEndpointRegistry endpointRegistry endpointRegistry.getListenerContainer(“consumer1”).stop(); endpointRegistry.getListenerContainer(“consumer1”).start(); We are deploying the microservice on kubernetes pod so there might be multiple deployments for the same microservice. how could i manage to start and stop the consumer on all the

KafkaException: class is not an instance of org.apache.kafka.common.serialization.Deserializer

I want to implement Kafka producer which sends and receives Java Serialized Objects. I tried this: Producer: } Send object: Consumer: // Receive Object When I deploy the Producer I get error during deployment: Caused by: org.apache.kafka.common.KafkaException: class org.engine.plugin.transactions.factory.SaleResponseFactory is not an instance of org.apache.kafka.common.serialization.Deserializer Custom object import org.apache.kafka.common.serialization.Deserializer; @Getter @Setter @NoArgsConstructor @AllArgsConstructor @Builder(toBuilder = true) public class SaleResponseFactory implements

How to use avro native decoder when using a PollableMessageSource input in spring cloud stream?

I’m using a PollableMessageSource input to read from a Kafka topic. Messages on that topic are in Avro. use-native-decoding was set to true when those messages were published. This is how I’m polling: pollableChannels is just an injected instance of this interface: After seeing that the TypeClassName is not being formed properly (it’s nested objects are set to null by

Advertisement