Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
fix(route-kafka.xml) : nouvelle route avec dacoupage par agence.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineArthurG committed Apr 26, 2023
1 parent ead88ff commit d7ab790
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
3 changes: 1 addition & 2 deletions scripts/quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Variables
BROKER="localhost:9094"
TOPIC="temps-attente"
DELIMITER="idAgence"

# URL RedPanda
URL="http://0.0.0.0:8081/topics/$TOPIC?o=-1&p=-1&q&s=50#messages"
Expand All @@ -23,7 +22,7 @@ if #sudo docker exec -it kafka_tps_attente_kml kafka-topics.sh --bootstrap-serve
else
# créer un nouveau topic
#docker exec -it kafka_tps_attente_kml kafka-console-producer.sh --broker-list $BROKER --topic $TOPIC
sudo docker exec -it kafka_tps_attente_kml kafka-topics.sh --bootstrap-server $BROKER --create --topic $TOPIC parse.key=true --property key.separator=$DELIMITER --partitions 1 --replication-factor 1
sudo docker exec -it kafka_tps_attente_kml kafka-topics.sh --bootstrap-server $BROKER --create --topic $TOPIC --partitions 1 --replication-factor 1

# vérifier si la création du topic est réussie
if [ $? -eq 0 ]; then
Expand Down
20 changes: 10 additions & 10 deletions scripts/route-kafka.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
<unmarshal>
<json library="Jackson" prettyPrint="false" />
</unmarshal>

<!-- JSON -->
<!-- Conversion des données au format JSON -->
<marshal>
<json library="Jackson" prettyPrint="false" />
</marshal>

<!-- URL de destination Kafka et paramétrage de la clé -->
<to uri="kafka:temps-attente?brokers=127.0.0.1:9094&amp;key=idAgence"/>

<!-- Split le contenu en plusieurs messages -->
<split>
<simple>${body}</simple>
<to uri="kafka:temps-attente?brokers=127.0.0.1:9094&amp;key=idAgence"/>
</split>

</route>
</routes>

</routes>


0 comments on commit d7ab790

Please sign in to comment.