Updating catalog-service

We have to reconfigure our catalog-service again so that it works with the PostgreSQL database.

Examples refrence: chapter7/catalog-service-openshift-postgresql.

Let's start with the pom.xml changes—we have to add Postgres dependency to it:

(...)    <dependencies>        (...)        <dependency>            <groupId>org.wildfly.swarm</groupId>            <artifactId>jpa</artifactId>            <version>${version.wildfly.swarm}</version>        </dependency>        <!-- 1 -->        <dependency>            <groupId>org.postgresql</groupId>            <artifactId>postgresql</artifactId>            <version>${version.postgresql}</version>        </dependency>    </dependencies>(...)

We have changed the database driver from h2 to PostgreSQL (1).

Let's change the datasource configuration:

swarm:  datasources:    data-sources: CatalogDS: ...

Get Hands-On Cloud Development with WildFly now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.