- Notifications
You must be signed in to change notification settings - Fork2
Fastest way to turn your robot files into an event driven service. ⚡️🤖
License
yusufcanb/reactive-robot
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This project aims to turn Robot Framework projects into event-driven services using popular message brokers like RabbitMQ, Kafka or MQTT.
You can install reactive-robot into projects using pip;
pip install reactive-robotCreate a definition file calledreactive-robot.yml then paste following configuration;
service_name:Example Robot Serviceservice_version:1.0.0connector:driver:reactive_robot.connectors.mqtt.MQTTConnectorconnection_url:mqtt://localhost:1883bindings: -name:Example Tasktopic:robot-queuerobot:file:your-robots/examples.robotargs:null
You're all set!Now all you have to do is start the service;
python -m reactive_robot serveYou should see the following output;
$ python -m reactive_robot serve2021-11-27 18:22:58,517 - [INFO] - reactive_robot.serve::serve::40 - Using Robot Framework v4.1.2 (Python 3.10.0 on darwin)2021-11-27 18:22:58,518 - [INFO] - reactive_robot.serve::serve::47 - Event loop started. Waiting for events.Finally publish a message to see your robots are running.
python tests/mqtt/publish.py localhost 1883In this section you can find example implementations with different message brokers;You needdocker anddocker-compose in order to execute example projects.
Navigate to theexamples/kafka
cd examples/kafkaThen start containers with below;
docker-compose upFinally, trigger an event in basic topic to see your robots are running;
docker-compose exec robot-service python /opt/service/publish.py basicNavigate to theexamples/mqtt
cd examples/mqttThen start containers with below;
docker-compose upFinally, trigger an event to see your robots are running;
docker-compose exec mqtt-broker /opt/hivemq-4.7.2/tools/mqtt-cli/bin/mqtt pub --topic basic --message TEST_VAR:321In theexamples/ directory you can find example projects which implements all recipes below;
Here you can find an example Dockerfile to convert your Robot Framework projects into dockerized event-driven service
FROM robotframework/rfdockerWORKDIR /opt/serviceCOPY . /opt/serviceRUN pip install -r requirements.txt # Your project dependencies.# reactive-robot setupCOPY reactive-robot.yml .RUN pip install reactive-robotCMD ["python","-m","reactive-robot","serve"]
Then, we can build the image with following;
docker build -t robot-service:1.0.0 .Finally, run your service;
docker run -it robot-service:1.0.0Distributed under the Apache License 2.SeeLICENSE for more information.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create.Any contributions areappreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/some-feature) - Commit your Changes (
git commit -m 'some feature added') - Push to the Branch (
git push origin feature/some-feature) - Open a Pull Request
About
Fastest way to turn your robot files into an event driven service. ⚡️🤖
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
