Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Aslhans committed Nov 9, 2019
1 parent 96c74e4 commit 1eed661
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
Regularflow
========================================================

This module allows you to create trafic light clusters that interact together to regulate circulation.
This module allows you to create trafic light clusters that interact together to regulate circulation.
Trafic lights are smart and can take decision according to the environnement.

You need to have Apache Kafka and Zookeper for the Stream communication.

First you need to create cluster for

``from confluent_kafka.admin import AdminClient, NewTopic

adminConfig = {
'bootstrap.servers': 'localhost:9092'
}

topicList = ["manager0", "cluster0", "display"]
partitions = [4, 4, 4]
replications = [1, 1, 1]

if __name__ == '__main__' :
newTopics = []
adminClient = AdminClient(adminConfig)
adminClient.delete_topics(topicList)
adminClient.delete_topics(["__consumer_offsets"])
for i in range(len(topicList)):
newTopics.append(NewTopic(topicList[i], partitions[i] , replications[i]))
print(newTopics)
adminClient.create_topics(newTopics)

``
Install with setup :

./setup install

Usage example :

Later...
Once topic are created, you can found example of Usage

This code is under license owner Slohan SAINTE-CROIX.

0 comments on commit 1eed661

Please sign in to comment.