This projects show example of how to integrate apicurio with kafka
-
setup kafka and a topic "events"
-
extract server certificate and import it into a java key store as trust store. Configure application.yaml
-
install service registry and import the event avro schema
mvn generate-sources -Pupload
-
adjust application.yaml to use kafka and service registry endpoints and the create trust store
bootstrap-servers: my-cluster-kafka-bootstrap-streams-playground-1.lab.redhat.com:443 ... properties: apicurio: registry: url: example-apicurioregistry-kafkasql.strimzi.lab.redhat.com/apis/registry/v2
-
generate event class
mvn generate-sources -Pavro
-
build and package:
mvn clean package
-
send a rest request to produce and consume events
curl --location --request POST 'http://localhost:8080/kafka/publish' \ --header 'Content-Type: application/json' \ --data-raw '{ "name": "some name", "description": "some description" }'
mvn generate-sources -DskipTests -Pavro
mvn generate-sources -Pupload
mvn generate-sources -Pdownload
oc extract secret/my-cluster-cluster-ca-cert -n strimzi --keys=ca.crt --to=- > ca-crt-1.pem
keytool -import -file ca-crt-1.pem -keystore ./truststore-cluster-1.jks -storepass p@ssw0rd