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.
- Connect to a Kafka cluster.
- Define a Kafka topic as a source topic.
- Define a virtual topic and publish it to the gateway group of your Event Gateway.
- Subscribe to the virtual topic.
- 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
kcatexample 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.secretNamein yourgateway_k8s.yamlfile.b. Locate the CA certificate in the
data.ca.crtproperty 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.crtd. Insert the decoded certificate into the code sample.
- On Docker Event Gateway, use the CA certificate that you configured for access to the gateway.