Skip to content

secorolab/soprano_scenery_kafka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

soprano_scenery_kafka

At the root of this repository you should create an .env file that contains the login information for Kafka.

The consumer listens to the floorplan-model topic, generates the corresponding artefacts, and publishes their path in the server in the scenery-artefacts topic.

Requirements

This assumes you have a local installation of the FloorPlan DSL and the scenery_builder.

You'll also need to install Confluent Kafka and other requirements:

pip install confluent-kafka requests dotenv

.env file

Create an .env file to store your credentials and the relevant API endpoints, for example:

KAFKA_USER=myuser
KAFKA_PASS=12345pass
KAFKA_URL=kafka-url:9000
REST_UPLOAD_ARTEFACT_URL=http://server-url:8000/api/upload/artefact

Running

After activating your virtual environment, simply run the floorplan consumer:

python floorplan_consumer.py

The floorplan_bim_producer.py and artefact_consumer.py are mockup scripts to test subscribing and publishing to the Kafka topics.

Using Docker

After building or pulling the Docker image, just run a container. The default CMD is already set for the Kafka consumer. You should use the argument --env-file to pass the path of the .env file containing the credentials to login and URLs, for example:

docker run --env-file .env -it mat_kafka:latest

The Dockerfile uses the images of the development branch of the two floorplan components. The images are built as part of the CI and hosted on GitHub.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages