Skip to content

Commit db294cc

Browse files
authored
Merge pull request #151 from pjgg/refactor/remove-kafka-scenarios
Refactor kafka modules: Move 012 scenario to 301 scenario
2 parents 9e6a873 + 4e3fac4 commit db294cc

38 files changed

+270
-377
lines changed

012-quarkus-kafka-streams/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Quarkus Kafka Streams
1+
# Quarkus Kafka Streams (moved to [301-quarkus-vertx-kafka](../301-quarkus-vertx-kafka))
22

33
## Recommended Readings
44

012-quarkus-kafka-streams/pom.xml

-45
This file was deleted.

012-quarkus-kafka-streams/src/main/resources/application.properties

-36
This file was deleted.

012-quarkus-kafka-streams/src/main/resources/docker-compose-confluent.yaml

-69
This file was deleted.

012-quarkus-kafka-streams/src/main/resources/docker-compose-strimzi.yaml

-34
This file was deleted.

012-quarkus-kafka-streams/src/test/java/io/quarkus/qe/StrimziKafkaResource.java

-37
This file was deleted.

012-quarkus-kafka-streams/src/test/resources/application.properties

-37
This file was deleted.

301-quarkus-vertx-kafka/README.md

+60-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
# Quarkus Vertx Kafka Ext
1+
# Table of Contents
2+
1. [Quarkus Vertx Kafka Ext](#quarkus-vertx-kafka-ext)
3+
2. [Quarkus Kafka Streams](#quarkus-kafka-streams)
24

3-
## Recommended Readings
5+
## Quarkus Vertx Kafka Ext
6+
7+
### Recommended Readings
48

59
[Quarkus Apache Kafka Reactive Messaging](https://quarkus.io/guides/kafka)
610

@@ -12,14 +16,14 @@
1216

1317
[Test Profiles: writing your profile](https://quarkus.io/guides/getting-started-testing#writing-a-profile)
1418

15-
## Requirements
19+
### Requirements
1620

1721
To compile and run this demo you will need:
1822

1923
- JDK 11+
2024
- Docker / docker-compose
2125

22-
## Scope of the testing
26+
### Scope of the testing
2327

2428
Vert.x Kafka exploratory test.
2529
* Kafka producer
@@ -38,34 +42,79 @@ so we don't really need a new verticle to consume Kafka in a reactive Non-blocki
3842
[1]: https://vertx.io/docs/vertx-core/java/#_verticles
3943
[2]: https://vertx.io/docs/vertx-core/java/#_executing_periodic_and_delayed_actions
4044

41-
## Live coding with Quarkus
45+
### Live coding with Quarkus
4246

43-
### Strimzi:
47+
#### Strimzi:
4448

4549
> docker-compose -f docker-compose-strimzi.yaml up
4650
>
4751
> mvn quarkus:dev
4852
49-
### Confluent:
53+
#### Confluent:
5054
> docker-compose -f docker-compose-confluent.yaml up
5155
>
5256
> mvn -Dquarkus.profile=confluent quarkus:dev
5357
54-
### Run automated tests
58+
#### Run automated tests
5559
> mvn test
5660
57-
## Troubleshooting
61+
### Troubleshooting
5862

59-
### When I swap from Strimzi/confluent sometimes Kafka broker doesn't weak up (docker-compose).
63+
#### When I swap from Strimzi/confluent sometimes Kafka broker doesn't weak up (docker-compose).
6064
Is something that We should investigate, must be for some service name collisions. It's the middle time you could clean your docker containers by running the following commands:
6165
> docker stop $(docker ps -a -q)
6266
>
6367
> docker rm $(docker ps -a -q)
6468
65-
### [Only Fedora] When I launch a docker compose, kafka broker can't reach Zookeper node rather a internal network issue.
69+
#### [Only Fedora] When I launch a docker compose, kafka broker can't reach Zookeper node rather a internal network issue.
6670
`error: kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection while in state: CONNECTING
6771

6872
Looks that the default backend for firewalld was changed from iptables to nftables, since Fedora32. A quick patch it's a rollback to iptables as firewalld backend.
6973
> sudo sed -i 's/FirewallBackend=nftables/FirewallBackend=iptables/g' /etc/firewalld/firewalld.conf
7074
>
7175
> sudo systemctl restart firewalld docker
76+
77+
## Quarkus Kafka Streams
78+
79+
### Recommended Readings
80+
81+
[Quarkus Apache Kafka Streams](https://quarkus.io/guides/kafka-streams)
82+
83+
### Requirements
84+
85+
To compile and run this demo you will need:
86+
87+
- JDK 11+
88+
- Docker / docker-compose
89+
90+
### Scope of the testing
91+
92+
Kafka streams
93+
* Kafka producer
94+
* Kafka consumer
95+
* Kafka stream
96+
* Kafka stream 'windowed'
97+
* Automating testing (JVM/native)
98+
99+
**Brief description:** Login monitor alerts. This kafka stream will handle login status events, and will group these events in fixed time windows.
100+
So if the number of wrong access excess a threshold, then a new alert event is thrown. All aggregated events(not only unauthorized) are persisted.
101+
102+
![Architecture Diagram](docs/LoginMonitor.png)
103+
104+
### Live coding with Quarkus
105+
106+
Monitor url: `http://localhost:8080/monitor/stream`
107+
108+
#### Strimzi:
109+
110+
> docker-compose -f docker-compose-strimzi.yaml up
111+
>
112+
> mvn quarkus:dev
113+
114+
#### Confluent:
115+
> docker-compose -f docker-compose-confluent.yaml up
116+
>
117+
> mvn quarkus:dev
118+
119+
#### Run automated tests
120+
> mvn test

0 commit comments

Comments
 (0)