org.springframework.cloud.stream.annotation.StreamMessageConverter Java Examples

The following examples show how to use org.springframework.cloud.stream.annotation.StreamMessageConverter. 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 File: BillingApp.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@StreamMessageConverter
public MessageConverter bookingOrderMessageConverter() throws IOException {
  MessageConverter avroSchemaMessageConverter = new AvroSchemaMessageConverter(
      MimeType.valueOf("application/*+avro"));
  ((AvroSchemaMessageConverter) avroSchemaMessageConverter)
      .setSchemaLocation(new ClassPathResource("avro/billingOrder.avsc"));
  return avroSchemaMessageConverter;
}
 
Example #2
Source File: AppConfig.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@StreamMessageConverter
public MessageConverter bookingOrderMessageConverter() throws IOException {
  LOG.info("avro message converter bean initialized.");
  MessageConverter avroSchemaMessageConverter = new AvroSchemaMessageConverter(
      MimeType.valueOf("application/*+avro"));
  ((AvroSchemaMessageConverter) avroSchemaMessageConverter)
      .setSchemaLocation(new ClassPathResource("avro/bookingOrder.avsc"));
  return avroSchemaMessageConverter;
}
 
Example #3
Source File: BillingApp.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@StreamMessageConverter
public MessageConverter bookingOrderMessageConverter() throws IOException {
  MessageConverter avroSchemaMessageConverter = new AvroSchemaMessageConverter(
      MimeType.valueOf("application/*+avro"));
  ((AvroSchemaMessageConverter) avroSchemaMessageConverter)
      .setSchemaLocation(new ClassPathResource("avro/bookingOrder.avsc"));
  return avroSchemaMessageConverter;
}
 
Example #4
Source File: AppConfig.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@Bean
@StreamMessageConverter
public MessageConverter bookingOrderMessageConverter() throws IOException {
  LOG.info("avro message converter bean initialized.");
  MessageConverter avroSchemaMessageConverter = new AvroSchemaMessageConverter(
      MimeType.valueOf("application/*+avro"));
  ((AvroSchemaMessageConverter) avroSchemaMessageConverter)
      .setSchemaLocation(new ClassPathResource("avro/bookingOrder.avsc"));
  return avroSchemaMessageConverter;
}
 
Example #5
Source File: BusJacksonAutoConfiguration.java    From spring-cloud-bus with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean(name = "busJsonConverter")
@StreamMessageConverter
public AbstractMessageConverter busJsonConverter(
		@Autowired(required = false) ObjectMapper objectMapper) {
	return new BusJacksonMessageConverter(objectMapper);
}
 
Example #6
Source File: KafkaBinderConfiguration.java    From spring-cloud-stream-binder-kafka with Apache License 2.0 4 votes vote down vote up
@Bean
@StreamMessageConverter
@ConditionalOnMissingBean(KafkaNullConverter.class)
MessageConverter kafkaNullConverter() {
	return new KafkaNullConverter();
}
 
Example #7
Source File: EventPublisherAutoConfiguration.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 
 * @return the protostuff io message converter
 */
@Bean
@StreamMessageConverter
public MessageConverter busProtoBufConverter() {
    return new BusProtoStuffMessageConverter();
}
 
Example #8
Source File: CustomMessageConverterTests.java    From spring-cloud-stream with Apache License 2.0 4 votes vote down vote up
@Bean
@StreamMessageConverter
public MessageConverter fooConverter() {
	return new FooConverter();
}
 
Example #9
Source File: CustomMessageConverterTests.java    From spring-cloud-stream with Apache License 2.0 4 votes vote down vote up
@Bean
@StreamMessageConverter
public MessageConverter barConverter() {
	return new BarConverter();
}