Setting up JDBC connector for PostgreSQL?

Hi,

I have been using the DBaaS provider Aiven for 3 weeks now to manage and administer my databases. Currently I have data stored in my object-relational database PostgreSQL. To be able to process data streams and forward them to third party systems, I am currently setting up Apache Kafka. To load the data from PostgreSQL into Kafka I need a JDBC connector, right? How can I set this up with Aiven?

Yeah, right. Using the JDBC connector you can push data from a relational database, in your case PostgreSQL, to Kafka. Before you can set up the connector, you need the following information from the Aiven console:

  • for the Kafka service: KAFKA_HOST, KAFKA_PORT, KAFKA_CONNECT_SERVICE_URI

  • for the PostgreSQL service PG_SERVICE_URI, PG_HOST, PG_PORT, PG_USER, PG_PW, PG_DEFAULT_DB

A typical JDBC URL that is required would look something like this: “JDBC_URL=jdbc:postgresql://PG_HOST:PG_PORT/PG_DEFAULT_DB? ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory” First you need to log in to PostgreSQL and create a schema and then create a Json file. Then you can create the JDBC connector. In a separate terminal you have to run the Consumer console. You can find the exact commands and information about the schemas on the official page (in the support area) for copying: https://aiven.io/postgresql