• Stars
    star
    405
  • Rank 106,270 (Top 3 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A scalable, event-driven and event-sourced Java EE application

Scalable, event-driven coffee shop

How to use event sourcing in several services with an event-driven architecture, Apache Kafka and Java EE.

Run

  1. Start Apache Kafka brokers, e.g. using Docker compose: wurstmeister/kafka-docker. Configure the KAFKA_ADVERTISED_HOST_NAME to your corresponding IP address.

  2. Configure each of the kafka.properties files with bootstrap.servers=<your-IP>:9092.

  3. Build and run the individual instances. On each of the orders/, beans/ and barista/ directories, execute build-run-local.sh. This builds the Gradle project, builds the Docker image and starts a new instance of the given service.

Usage

The following will demonstrate the usage of the HTTP endpoints and example responses.

  1. In order to create coffee orders you have to add beans to the beans storage first:

$> curl http://localhost:8002/beans/resources/beans -i -XPOST \
  -H 'content-type: application/json' \
  -d '{"beanOrigin": "Colombia", "amount": 10}'

HTTP/1.1 204 No Content
X-Powered-By: Undertow/1
Server: WildFly/10
Date: Fri, 17 Nov 2017 20:49:26 GMT
  1. Check the creation of the beans:

$> curl http://localhost:8002/beans/resources/beans

{"Colombia":10}
  1. Create a new coffee order:

$> curl http://localhost:8001/orders/resources/orders/ -i -XPOST \
  -H 'Content-type: application/json' \
  -d '{"beanOrigin": "Colombia", "coffeeType": "Espresso"}'

HTTP/1.1 202 Accepted
Connection: keep-alive
X-Powered-By: Undertow/1
Server: WildFly/10
Location: http://localhost:8001/orders/resources/orders/c099c158-b748-4115-bed3-7b5dfff70771
Content-Length: 0
Date: Fri, 17 Nov 2017 20:51:16 GMT
  1. Check the creation of the coffee order using your Location header, for example:

$> curl http://localhost:8001/orders/resources/orders/c099c158-b748-4115-bed3-7b5dfff70771

{"status":"started","type":"espresso","beanOrigin":"Colombia"}

More Repositories

1

jaxrs-analyzer

Creates REST documentation for JAX-RS projects
Java
320
star
2

dotfiles

Dotfiles
Shell
227
star
3

jaxrs-analyzer-maven-plugin

Maven plugin for the JAX-RS Analyzer
Java
91
star
4

tekton-argocd-example

Shell
61
star
5

coffee-testing

Code examples for effective enterprise testing
Java
53
star
6

coffee

Yet another coffee shop example project
Java
42
star
7

jaxrs-hypermedia

Putting Hypermedia back in REST with JAX-RS
Java
39
star
8

zero-downtime-kubernetes

Shell
27
star
9

asciiblog

Blog application powered by Quarkus, AsciiDoc & Git
Java
23
star
10

openliberty-config-example

Java
17
star
11

modern-java-enterprise

Java
14
star
12

quarkus-playground

Java
14
star
13

instrument-craft-shop

Java
13
star
14

istio-workshop

Java
12
star
15

favorite-coffee

Coffee recommendation with Neo4j & Quarkus
Java
12
star
16

coffee-shop

Coffee example backend for the REST with Hypermedia and Java video course
Java
8
star
17

capitalize-titles

Java
6
star
18

asciidoctor-blog-extension

An Asciidoctor extension for a blog entries macro.
Java
6
star
19

coffee-testing-config

Shell
5
star
20

docker

Docker images used in presentations, workshops & demos
Dockerfile
5
star
21

javaone-lightweight-ee

Code examples of my JavaOne Lightweight Java EE talk
Java
5
star
22

hello-prometheus

Integrating Prometheus into Java EE applications
Java
5
star
23

quarkus-logging-comparison

Java
4
star
24

siren4javaee

Lean and minimalistic Java EE library for creating Siren JSONP responses
Java
4
star
25

movies-java-quarkus

Neo4j Movies Example with Quarkus
Cypher
3
star
26

ibm-cloud-tools

Shell
3
star
27

java-playground

Java
3
star
28

jbreak-testing

Java
3
star
29

effective-design-principles

Java
2
star
30

porcupine-metrics

Emits MicroProfile metrics from Porcupine pipelines
Java
2
star
31

cloud-native-ee

Cloud Native Java EE examples
Java
2
star
32

junit5-playground

Testing the milestone of Junit5
Java
2
star
33

liberty-dev-experience

Java
2
star
34

wjax-coffee-testing

Materials for my W-JAX talk on 2016-11-08
Java
2
star
35

mp-context-propagation-example

Java
2
star
36

todos-example

Example of TODO application with session storage and no persistence
Java
2
star
37

multi-module-performance

Testing the overhead of Maven multiple modules
Java
2
star
38

jcache-persistence-example

Example of JCache with MapDB as persistence provider
Java
2
star
39

todos

Java EE application which manages tasks
Java
2
star
40

kaffeehaus-demo

Java
1
star
41

javahub-demo-backend

Backend for the JavaHub demo
Java
1
star
42

jaxrs-analyzer-st

System test for JAX-RS Analyzer
Java
1
star
43

greeting-processor

Backend for hello-cloud
Java
1
star
44

maker-bot

Java
1
star
45

hello-joker

Joker presentation project 2017-11-03
Java
1
star
46

backpressure-sample

Java
1
star
47

sdaschner

1
star
48

quarkus-ws-2023-04-17

Java
1
star
49

javahub-demo-frontend

Java
1
star
50

jsr-370-examples

Examples of JSR 370 SNAPSHOT API -- use with caution 😉
Java
1
star
51

barista

Java
1
star
52

javazone-lightweight-ee

Code snippets from Lightweight Java EE JavaZone talk
Java
1
star
53

joker-greetings

Joker presentation project 2017-11-03
Java
1
star
54

kubernetes-hello-workshop

Java
1
star
55

neo4j-tools

1
star
56

liberty-tools

1
star
57

qatalk-hello-cloud

Hello cloud application of cloud native night @ QAware on 2017-09-13
Java
1
star