Java Code Examples for org.springframework.kafka.support.converter.StringJsonMessageConverter

The following examples show how to use org.springframework.kafka.support.converter.StringJsonMessageConverter. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: grussell-spring-kafka   Source File: CommonConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
public ConcurrentKafkaListenerContainerFactory<String, String> jsonKafkaListenerContainerFactory() {
	ConcurrentKafkaListenerContainerFactory<String, String> factory =
			new ConcurrentKafkaListenerContainerFactory<>();
	factory.setConsumerFactory(consumerFactory());
	factory.setMessageConverter(new StringJsonMessageConverter());
	return factory;
}
 
Example 2
Source Project: spring-kafka   Source File: SenderConfig.java    License: MIT License 5 votes vote down vote up
@Bean
public KafkaTemplate<String, String> kafkaTemplate() {
  KafkaTemplate<String, String> template = new KafkaTemplate<>(producerFactory());
  template.setMessageConverter(new StringJsonMessageConverter());

  return template;
}
 
Example 3
Source Project: spring-kafka   Source File: ReceiverConfig.java    License: MIT License 5 votes vote down vote up
@Bean
public ConcurrentKafkaListenerContainerFactory<String, String> kafkaListenerContainerFactory() {
  ConcurrentKafkaListenerContainerFactory<String, String> factory =
      new ConcurrentKafkaListenerContainerFactory<>();
  factory.setConsumerFactory(consumerFactory());
  factory.setMessageConverter(new StringJsonMessageConverter());

  return factory;
}
 
Example 4
@Bean
public RecordMessageConverter converter() {
    return new StringJsonMessageConverter();
}
 
Example 5
Source Project: loc-framework   Source File: LocKafkaAutoConfiguration.java    License: MIT License 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public RecordMessageConverter recordMessageConverter() {
  return new StringJsonMessageConverter(objectMapper);
}
 
Example 6
Source Project: spring-cloud-contract-samples   Source File: Application.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public RecordMessageConverter converter() {
	return new StringJsonMessageConverter();
}
 
Example 7
Source Project: spring-cloud-contract-samples   Source File: Application.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public RecordMessageConverter converter() {
	return new StringJsonMessageConverter();
}