From: Gustavo Martin Morcuende Date: Sun, 29 Jan 2017 09:55:07 +0000 (+0100) Subject: Using Kafka 0.10.1.1 X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=c320ba45191a1a44c13a404492f0e11169f34f47;p=JavaForFun Using Kafka 0.10.1.1 --- diff --git a/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-consumer-example/src/main/java/de/example/spring/kafka/MyCustomMessageConverter.java b/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-consumer-example/src/main/java/de/example/spring/kafka/MyCustomMessageConverter.java index 51eae29..13667ad 100644 --- a/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-consumer-example/src/main/java/de/example/spring/kafka/MyCustomMessageConverter.java +++ b/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-consumer-example/src/main/java/de/example/spring/kafka/MyCustomMessageConverter.java @@ -21,6 +21,6 @@ public class MyCustomMessageConverter extends AbstractMessageConverter { logger.info("convertFromInternal, payload: " + payload); - return payload; + return (payload instanceof String ? payload : new String((byte[]) payload)); } } diff --git a/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-consumer-example/src/main/java/de/example/spring/kafka/ReceiverConfig.java b/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-consumer-example/src/main/java/de/example/spring/kafka/ReceiverConfig.java index 5a9d1e2..3788a7b 100644 --- a/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-consumer-example/src/main/java/de/example/spring/kafka/ReceiverConfig.java +++ b/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-consumer-example/src/main/java/de/example/spring/kafka/ReceiverConfig.java @@ -3,7 +3,7 @@ package de.example.spring.kafka; import org.springframework.cloud.stream.schema.avro.AvroSchemaMessageConverter; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.core.io.ClassPathResource; +//import org.springframework.core.io.ClassPathResource; import org.springframework.messaging.converter.MessageConverter; import org.springframework.util.MimeType; @@ -28,5 +28,5 @@ public class ReceiverConfig { AvroSchemaMessageConverter converter = new AvroSchemaMessageConverter(MimeType.valueOf("avro/bytes")); //converter.setSchemaLocation(new ClassPathResource("schemas/User.avro")); return converter; - } + } } diff --git a/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-example-bom/pom.xml b/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-example-bom/pom.xml index ebbd9eb..769c420 100644 --- a/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-example-bom/pom.xml +++ b/SpringJava/Kafka/SpringCloudStream/spring-cloud-stream-kafka-example-bom/pom.xml @@ -39,7 +39,30 @@ spring-cloud-starter-stream-kafka 1.1.1.RELEASE - + + + + org.springframework.kafka + spring-kafka + 1.1.2.RELEASE + + + org.springframework.integration + spring-integration-kafka + 2.1.0.RELEASE + + + org.apache.kafka + kafka_2.11 + 0.10.1.1 + + + org.slf4j + slf4j-log4j12 + + + + org.springframework.cloud