-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb18802
commit 2eb7d86
Showing
27 changed files
with
2,263 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Citrus Quarkus Demo | ||
|
||
This project uses Quarkus to implement a sample event-driven application. | ||
The project uses the Quarkus test framework to set up a dev services environment with JUnit Jupiter where the application is running on the localhost. | ||
The Quarkus dev services capabilities include starting Testcontainers automatically during the test in order to simulate the surrounding infrastructure | ||
(PostgreSQL database and the Kafka message broker). | ||
|
||
If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ . | ||
|
||
The Quarkus demo application is a food market event-driven application that listens for incoming events of type `booking` and `supply`. | ||
|
||
![Food Market App](food-market-app-demo.png) | ||
|
||
Users are able to place a booking event that references a product and gives an amount as well as an accepted price. | ||
At the same time suppliers may add their individual supply events again referencing a product with an amount and a selling price. | ||
|
||
As soon as bookings and supplies do match in all criteria the food market application will produce booking-completed and shipping events. | ||
|
||
All events are produced and consumed with Kafka event streams. | ||
Bookings and supplies with their individual status are stored in a PostgreSQL database. | ||
|
||
## Running the application in dev mode | ||
|
||
You can run your application in dev mode that enables live coding using: | ||
```shell script | ||
./mvnw compile quarkus:dev | ||
``` | ||
|
||
> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/. | ||
## Running the Citrus tests | ||
|
||
Quarkus test is using JUnit Jupiter as a test driver. | ||
This means you can run the tests just like any other JUnit test (e.g. from your Java IDE, with Maven). | ||
|
||
The Citrus tst capabilities are added on top of `@QuarkusTest` so you will not need any other commands to run the tests. | ||
|
||
## Packaging and running the application | ||
|
||
The application can be packaged using: | ||
```shell script | ||
./mvnw package | ||
``` | ||
It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory. | ||
Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory. | ||
|
||
The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`. | ||
|
||
If you want to build an _über-jar_, execute the following command: | ||
```shell script | ||
./mvnw package -Dquarkus.package.type=uber-jar | ||
``` | ||
|
||
The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`. | ||
|
||
## Creating a native executable | ||
|
||
You can create a native executable using: | ||
```shell script | ||
./mvnw package -Dnative | ||
``` | ||
|
||
Or, if you don't have GraalVM installed, you can run the native executable build in a container using: | ||
```shell script | ||
./mvnw package -Dnative -Dquarkus.native.container-build=true | ||
``` | ||
|
||
You can then execute your native executable with: `./target/kamelets-quarkus-demo-1.0.0-runner` | ||
|
||
If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling. | ||
|
||
## Building an image | ||
|
||
This is meant to produce a Knative image, to be pushed to quay.io. Update the application.properties to use your own repository. | ||
|
||
To build your image, run: | ||
```shell script | ||
./mvnw package -Dquarkus.container-image.build=true | ||
``` | ||
|
||
You can push your image using: | ||
```shell script | ||
docker push quay.io/{YOUR_USERNAME}/food-market-demo:1.0.0 | ||
``` | ||
|
||
## Related Guides | ||
|
||
- SmallRye Reactive Messaging - Kafka Connector ([guide](https://quarkus.io/guides/kafka-reactive-getting-started)): Connect to Kafka with Reactive Messaging | ||
- Apache Kafka Streams ([guide](https://quarkus.io/guides/kafka-streams)): Implement stream processing applications based on Apache Kafka | ||
|
||
## Provided Code | ||
|
||
### Reactive Messaging codestart | ||
|
||
Use SmallRye Reactive Messaging | ||
|
||
[Related Apache Kafka guide section...](https://quarkus.io/guides/kafka-reactive-getting-started) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.