Skip to content

Quarkus MicroProfile reactive postgres data access and REST API

License

Notifications You must be signed in to change notification settings

daggerok/quarkus-reactive-pg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quarkus-reactive-pg Build Status

Quarkus micro-profile starter using Gradle / Maven build tools.

getting started

./mvnw -Pdocker docker:start

#./mvnw process-resources flyway:migrate
./mvnw compile quarkus:dev

./mvnw -Pdocker docker:stop

MicroProfile static typed RestClient

add rest-client extension

 ./mvnw quarkus:add-extensions -Dextensions="quarkus-smallrye-rest-client"

or directly in pom.xml

<dependencies>
  <dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-smallrye-rest-client</artifactId>
  </dependency>
</dependencies>

declare proxy interface: HelloRestClient.java

import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

@Path("/")
@RegisterRestClient
public interface HelloRestClient {

  @GET
  @Produces(APPLICATION_JSON)
  String getHello();
}

usage

@Inject
@RestClient
HelloRestClient restClient;
// ...
var greeting = restClient.getHello();

resources

NOTE: This project has been based on GitHub: daggerok/main-starter