forked from confluentinc/demo-scene
-
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
8 changed files
with
734 additions
and
75 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 |
---|---|---|
|
@@ -25,5 +25,4 @@ delta_configs | |
.project | ||
.settings/ | ||
.DS_Store | ||
|
||
|
||
mqtt-tracker/.env |
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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
source .env | ||
|
||
echo "Waiting for Kafka Connect to start listening on $CONNECT_REST_ADVERTISED_HOST_NAME:$CONNECT_REST_PORT ⏳" | ||
while : ; do | ||
curl_status=$(curl -s -o /dev/null -w %{http_code} http://$CONNECT_REST_ADVERTISED_HOST_NAME:$CONNECT_REST_PORT/connectors) | ||
echo -e $(date) " Kafka Connect listener HTTP state: " $curl_status " (waiting for 200)" | ||
if [ $curl_status -eq 200 ] ; then | ||
break | ||
fi | ||
sleep 5 | ||
done | ||
# | ||
echo -e "\n--\n+> Creating Kafka Connect MQTT source" | ||
curl -X PUT -H "Content-Type:application/json" http://$CONNECT_REST_ADVERTISED_HOST_NAME:$CONNECT_REST_PORT/connectors/source-mqtt-01/config \ | ||
-d '{ | ||
"connector.class" : "io.confluent.connect.mqtt.MqttSourceConnector", | ||
"mqtt.server.uri" : "${file:/data/mqtt.credentials:MQTT_URL}", | ||
"mqtt.password" : "${file:/data/mqtt.credentials:MQTT_PASSWORD}", | ||
"mqtt.username" : "${file:/data/mqtt.credentials:MQTT_USERNAME}", | ||
"mqtt.topics" : "owntracks/#", | ||
"kafka.topic" : "data_mqtt", | ||
"key.converter": "org.apache.kafka.connect.storage.StringConverter", | ||
"value.converter": "org.apache.kafka.connect.converters.ByteArrayConverter", | ||
"tasks.max" : "1", | ||
"confluent.topic.bootstrap.servers" : "${CCLOUD_BROKER_HOST}:9092", | ||
"confluent.topic.sasl.jaas.config" : "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"${CCLOUD_API_KEY}\" password=\"${CCLOUD_API_SECRET}\";", | ||
"confluent.topic.security.protocol": "SASL_SSL", | ||
"confluent.topic.ssl.endpoint.identification.algorithm": "https", | ||
"confluent.topic.sasl.mechanism": "PLAIN", | ||
"confluent.topic.request.timeout.ms": "20000", | ||
"confluent.topic.retry.backoff.ms": "500" | ||
}' | ||
# |
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
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
Oops, something went wrong.