- public KafkaListenerContainerFactory<?> batchFactory(
- ConsumerFactory<String, Long> consumerFactory,
- CommonErrorHandler errorHandler)
- {
- ConcurrentKafkaListenerContainerFactory<String, Long> factory =
- new ConcurrentKafkaListenerContainerFactory<>();
+ public ProducerFactory<String, Object> producerFactory(KafkaProperties properties) {
+ return new DefaultKafkaProducerFactory<>(
+ properties.getProducer().buildProperties(),
+ new StringSerializer(),
+ new DelegatingByTypeSerializer(Map.of(
+ byte[].class, new ByteArraySerializer(),
+ ClientMessage.class, new JsonSerializer<>())));
+ }