Verifying your Event Gateway installation

To test your Event Gateway, create a topic and verify that a Kafka client application can access it as follows.

  1. Connect to a Kafka cluster.
  2. Define a Kafka topic as a source topic.
  3. Define a virtual topic and publish it to the gateway group of your Event Gateway.
  4. Subscribe to the virtual topic.
  5. Create a test application by using the sample code on the Catalog page to connect to the Event Gateway and consume from the published virtual topic. The kcat example can be run on the command line and provides helpful debugging of any certificate or security-related problems. The topic name on your Kafka cluster and the topic name that is exposed by the Event Gateway might not be the same.

Replace the CA certificate in the code sample with your Event Gateway gateway CA certificate. If you set kafka.listener.legacy.group.default.trust.pem when you installed your gateway, then you can download it from the Catalog page of the Event Endpoint Management UI. Otherwise, follow these steps:

  • On a Kubernetes Deployment or operator-managed Event Gateway:

    a. Identify the name of your gateway secret from the property spec.template.spec.containers[egw].volumes[certs].secret.secretName in your gateway_k8s.yaml file.

    b. Locate the CA certificate in the data.ca.crt property of the gateway secret:

    kubectl -n <gateway namespace> get -o yaml <secret name> | grep "ca.crt"
    

    Copy the certificate to a file called gateway-ca.crt.

    c. Base64 decode gateway-ca.crt:

    base64 -d gateway-ca.crt
    

    d. Insert the decoded certificate into the code sample.

  • On Docker Event Gateway, use the CA certificate that you configured for access to the gateway.