Skip to content

Commit

Permalink
use simple httpserver
Browse files Browse the repository at this point in the history
  • Loading branch information
vdesabou committed Sep 7, 2023
1 parent 6dd39f7 commit 52780a6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
28 changes: 28 additions & 0 deletions ccloud/fully-managed-connect-http-sink/docker-compose.noauth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
version: '3.5'
services:

httpserver:
build:
context: ../../connect/connect-http-sink/httpserver
hostname: httpserver
container_name: httpserver
ports:
- "9006:9006"

# https://github.com/shkoliar/docker-ngrok
ngrok:
image: shkoliar/ngrok:latest
hostname: ngrok
container_name: ngrok
ports:
- 4551:4551
links:
- httpserver
environment:
DOMAIN: httpserver
PORT: 9006
PROTOCOL: tcp
REGION: eu
AUTH_TOKEN: $NGROK_AUTH_TOKEN
DEBUG: "true"
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ else
exit 1
fi

docker-compose -f docker-compose.noauth.yml build
docker-compose -f docker-compose.noauth.yml down -v --remove-orphans
docker-compose -f docker-compose.noauth.yml up -d

sleep 5

log "Getting ngrok hostname and port"
NGROK_URL=$(curl --silent http://127.0.0.1:4551/api/tunnels | jq -r '.tunnels[0].public_url')
NGROK_HOSTNAME=$(echo $NGROK_URL | cut -d "/" -f3 | cut -d ":" -f 1)
NGROK_PORT=$(echo $NGROK_URL | cut -d "/" -f3 | cut -d ":" -f 2)

log "Creating http-topic topic in Confluent Cloud"
set +e
playground topic create --topic http-topic
Expand Down Expand Up @@ -49,7 +60,7 @@ playground ccloud-connector create-or-update --connector $connector_name << EOF
"kafka.api.secret": "$CLOUD_SECRET",
"topics": "http-topic",
"input.data.format": "AVRO",
"http.api.url": "http://httpstat.us/200/",
"http.api.url": "http://$NGROK_HOSTNAME:$NGROK_PORT",
"behavior.on.error": "fail",
"tasks.max" : "1"
}
Expand Down

0 comments on commit 52780a6

Please sign in to comment.