One of the most simple and flexible ways to communicate Onesait Platform Things devices
81
To get more information about Kafka application: kafka documentation
##Environments Followings environments are used to configure kafka client to connect with the platform:
To run kafka container you can execute following command:
docker run -d -it -v /mnt/logs -v /mnt/data \
-e "CONTAINER_TIMEZONE: Europe/Madrid" \
-e "KAFKA_URL=onesaitplatform.online" \
-e "KAFKA_PORT=9095" \
-e "KAFKA_TOKEN=e501b0b0358f45ff9181346d14e2de49" \
-e "KAFKA_CLIENT_PLATFORM=Ejemplo_Kafka_23" \
-e "KAFKA_PREFIX=ONTOLOGY_" \
-e "KAFKA_ONTOLOGY=EdgeFeedWoT" \
-e "KAFKA_RESEND_MESSAGES=100" \
-e "KAFKA_RESEND_PERSISTENCE_H=24" \
-e "KAFKA_RESEND_SEC=10" \
-e "MQTT_TOPIC=kafka_topic" \
--restart always --name edge.kafka onesaitplatform/edge-kafka:community
Another way to launch database application is to use docker-compose schema; docker-compose.yml file must be located at the same execution directory .
docker-compose pull
docker-compose up -d
version: '2'
services:
mqtt:
restart: always
image: onesaitplatform/edge-mqtt:community
container_name: edge.mqtt
volumes:
- /home/indra/docker/logs:/mosquitto/log
- /home/indra/docker/data:/mosquitto/data
networks:
- edgenet
kafka:
restart: always
image: onesaitplatform/edge-kafka:community
container_name: edge.kafka
environment:
CONTAINER_TIMEZONE: Europe/Madrid
KAFKA_URL: onesaitplatform.online
KAFKA_PORT: 9095
KAFKA_TOKEN: f846e4089d7f4f1fb635b5da5e3ec898
KAFKA_CLIENT_PLATFORM: KafkaInserts
KAFKA_PREFIX: ONTOLOGY_
KAFKA_ONTOLOGY: EdgeModbus
KAFKA_RESEND_MESSAGES: 100
KAFKA_RESEND_PERSISTENCE_H: 24
KAFKA_RESEND_SEC: 10
MQTT_TOPIC: /node1/kafka
volumes:
- /mnt/logs
- /mnt/data
depends_on:
- mqtt
links:
- mqtt
networks:
- edgenet
networks:
edgenet:
driver: bridge
Content type
Image
Digest
Size
68.8 MB
Last updated
about 7 years ago
docker pull onesaitplatform/edge-kafka:community