Skip to content

Commit

Permalink
Create topics with 2 partitions
Browse files Browse the repository at this point in the history
It makes more sense with the exemple since we do some repartitionning
  • Loading branch information
adrien-ben committed Sep 18, 2020
1 parent 18cbc86 commit 2c2b789
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ services:
- broker
command: "bash -c 'echo Waiting for Kafka to be ready... && \
cub kafka-ready -b broker:29092 1 20 && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic product_details && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic prices && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic sku_details && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic offer_details && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic products ' "
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 2 --replication-factor 1 --topic product_details && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 2 --replication-factor 1 --topic prices && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 2 --replication-factor 1 --topic sku_details && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 2 --replication-factor 1 --topic offer_details && \
kafka-topics --create --if-not-exists --zookeeper zookeeper:2181 --partitions 2 --replication-factor 1 --topic products ' "

akhq:
image: tchiotludo/akhq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafkaStreams;
import org.springframework.kafka.support.serializer.JsonDeserializer;
import org.springframework.kafka.support.serializer.JsonSerializer;
import org.springframework.kafka.support.serializer.JsonSerde;

@Slf4j
@Configuration
Expand Down Expand Up @@ -124,8 +123,6 @@ public KStream<String, Product> kStream(StreamsBuilder streamBuilder) {
}

private <T> Serde<T> jsonSerde(Class<T> targetClass) {
return Serdes.serdeFrom(
new JsonSerializer<>(mapper),
new JsonDeserializer<>(targetClass, mapper, false));
return new JsonSerde<>(targetClass, mapper).noTypeInfo().ignoreTypeHeaders();
}
}

0 comments on commit 2c2b789

Please sign in to comment.