setup.td 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. $ http-request method=POST url=http://toxiproxy:8474/proxies content-type=application/json
  10. {
  11. "name": "kafka",
  12. "listen": "0.0.0.0:9093",
  13. "upstream": "kafka:9092"
  14. }
  15. $ kafka-create-topic topic=input
  16. $ kafka-ingest topic=input format=bytes
  17. Rochester,NY,14618
  18. New York,NY,10004
  19. > CREATE CONNECTION IF NOT EXISTS kafka_conn1 TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT);
  20. > CREATE CONNECTION IF NOT EXISTS kafka_conn2 TO KAFKA (BROKER 'toxiproxy:9093', SECURITY PROTOCOL PLAINTEXT);
  21. # The source intentionally does not go through toxiproxy.
  22. > CREATE SOURCE input
  23. FROM KAFKA CONNECTION kafka_conn1 (TOPIC 'testdrive-input-${testdrive.seed}')
  24. > CREATE TABLE input_tbl (city, state, zip) FROM SOURCE input (REFERENCE "testdrive-input-${testdrive.seed}")
  25. FORMAT CSV WITH 3 COLUMNS
  26. INCLUDE OFFSET
  27. > CREATE CONNECTION IF NOT EXISTS csr_conn TO CONFLUENT SCHEMA REGISTRY (
  28. URL '${testdrive.schema-registry-url}'
  29. );
  30. > CREATE SINK output
  31. IN CLUSTER quickstart
  32. FROM input_tbl
  33. INTO KAFKA CONNECTION kafka_conn2 (TOPIC 'output-byo-sink-${testdrive.seed}')
  34. FORMAT AVRO USING CONFLUENT SCHEMA REGISTRY CONNECTION csr_conn
  35. ENVELOPE DEBEZIUM