-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |