Skip to content

Commit

Permalink
DEVX-1761: CCloud demo: create custom connect topic names so that the…
Browse files Browse the repository at this point in the history
…y can be deleted at the end (confluentinc#600)
  • Loading branch information
ybyzek authored May 1, 2020
1 parent 2f1dd7c commit c74b085
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ccloud/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ services:
CONNECT_PRODUCER_CLIENT_ID: "connect-cloud-worker-producer"
CONNECT_REST_PORT: 8087
CONNECT_GROUP_ID: "connect-cloud"
CONNECT_CONFIG_STORAGE_TOPIC: connect-configs
CONNECT_OFFSET_STORAGE_TOPIC: connect-offsets
CONNECT_STATUS_STORAGE_TOPIC: connect-statuses
CONNECT_CONFIG_STORAGE_TOPIC: connect-demo-configs
CONNECT_OFFSET_STORAGE_TOPIC: connect-demo-offsets
CONNECT_STATUS_STORAGE_TOPIC: connect-demo-statuses
CONNECT_REPLICATION_FACTOR: 3
CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 3
CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 3
Expand Down
3 changes: 3 additions & 0 deletions ccloud/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ rest.port=$CONNECT_REST_PORT
rest.advertised.name=connect-cloud
rest.hostname=connect-cloud
group.id=connect-cloud
config.storage.topic=connect-demo-configs
offset.storage.topic=connect-demo-offsets
status.storage.topic=connect-demo-statuses
EOF
create_connect_topics_and_acls $serviceAccount
export CLASSPATH=$(find ${CONFLUENT_HOME}/share/java/kafka-connect-replicator/replicator-rest-extension-*)
Expand Down
4 changes: 2 additions & 2 deletions ccloud/stop-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ do
done

# Delete topics in Confluent Cloud
topics_to_delete="pageviews users PAGEVIEWS_FEMALE PAGEVIEWS_REGIONS PAGEVIEWS_FEMALE_LIKE_89 USERS_ORIGINAL"
topics_to_delete="pageviews users PAGEVIEWS_FEMALE PAGEVIEWS_REGIONS PAGEVIEWS_FEMALE_LIKE_89 USERS_ORIGINAL connect-demo-configs connect-demo-offsets connect-demo-statuses"
for topic in $topics_to_delete
do
ccloud kafka topic describe $topic > /dev/null 2>&1 && ccloud kafka topic delete $topic
done

echo
echo
echo "Note: not deleting the connect topics in case they are used by other applications. Remaining topics in cluster:"
echo "Note: not deleting Confluent Control Center and related topics in case they are used by other applications. Remaining topics in cluster:"
ccloud kafka topic list
2 changes: 1 addition & 1 deletion utils/helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ function create_connect_topics_and_acls() {
serviceAccount=$1

echo "Connect: creating topics and ACLs for service account $serviceAccount"
for topic in connect-offsets connect-statuses connect-configs _confluent-monitoring _confluent-command ; do
for topic in connect-demo-configs connect-demo-offsets connect-demo-statuses _confluent-monitoring _confluent-command ; do
ccloud kafka topic create $topic &>/dev/null
ccloud kafka acl create --allow --service-account $serviceAccount --operation WRITE --topic $topic --prefix
ccloud kafka acl create --allow --service-account $serviceAccount --operation READ --topic $topic --prefix
Expand Down

0 comments on commit c74b085

Please sign in to comment.