Skip to content

Commit d613464

Browse files
committed
--wip-- [skip ci]
1 parent f2a02b8 commit d613464

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ If you want to use local versions of JHipster and the Kafka module:
105105
2. Create a JHipster project in a new folder: `mkdir myproject && cd myproject && jhipster` (you can also create a backend project only with `jhipster --skip-client`)
106106
3. Choose `Apache Kafka as asynchronous messages broker` in server side options when answering the following question : "Which other technologies would you like to use?"
107107
4. In the same folder, then run `yo jhipster-kafka` and then follow the use case you need
108-
5. After the generation have been done, run Kafka with: `docker-compose -f src/main/docker/kafka.yml up -d` (or without `-d` and ensure you have a docker-compose version >= 1.27.4)
108+
5. After the generation have been done, run Kafka with: `docker-compose -f src/main/docker/kafka.yml up -d` (or without `-d` and ensure you have the latest docker-compose version and that you have uncommented `127.0.0.1:` in your `kafka.yml` locally)
109109
6. Run your application with: `./mvnw`
110110

111111
The different [use cases](USE_CASES.md) are listed on another page.
@@ -168,8 +168,6 @@ The **END** represents the end of the prompts below, when files are written afte
168168
<li><em>If "N" was selected:</em> <strong>END</strong></li>
169169
</ul>
170170

171-
</code>
172-
173171
## Skip prompts
174172

175173
You can use `yo jhipster-kafka --skip-prompts` to use the default prompts values to generate:
@@ -200,9 +198,16 @@ Generated consumers should not be explicitly used in other classes as each of th
200198

201199
🚀 [AKHQ (previously known as KafkaHQ)](https://github.com/tchiotludo/akhq) can be used following those steps in the root directory:
202200

203-
1. Run `docker-compose -f src/main/docker/kafka.yml -f src/main/docker/akhq.yml up -d` to launch the ZooKeeper and Kafka services with AKHQ
204-
1. Go to [http://localhost:11817](http://localhost:11817)
205-
1. Start your application with `./mvnw` to manage your topics and more!
201+
1. Run `docker-compose -f src/main/docker/kafka.yml -f src/main/docker/akhq.yml up -d` to launch the ZooKeeper and Kafka services with AKHQ (or without `-d` and ensure you have the latest docker-compose version and that you have uncommented `127.0.0.1:` in your `kafka.yml` locally)
202+
2. Go to [http://localhost:11817](http://localhost:11817)
203+
3. Start your application with `./mvnw` to manage your topics and more!
204+
205+
## Schema Registry for Avro schemas
206+
207+
🚀 [Schema Registry](https://docs.confluent.io/platform/current/schema-registry/index.html) for Avro schemas can be used following those steps in the root directory:
208+
209+
1. Run `docker-compose -f src/main/docker/kafka.yml -f src/main/docker/schema-registry.yml up -d` to launch the ZooKeeper and Kafka services with AKHQ (or without `-d` and ensure you have the latest docker-compose version and that you have uncommented `127.0.0.1:` in your `kafka.yml` locally)
210+
2. Choose to generate Avro schemas (`.avsc` files) for your entities in prompts.
206211

207212
# How to contribute?
208213

generators/app/files.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,15 +333,20 @@ function writeKafkaDockerYaml(generator) {
333333
generator.dockerZookeeper = jhipsterConstants.DOCKER_ZOOKEEPER;
334334
generator.dockerKafka = jhipsterConstants.DOCKER_KAFKA;
335335
generator.dockerAkhq = 'tchiotludo/akhq:0.14.1';
336+
generator.dockerSchemaRegistry = 'confluentinc/cp-schema-registry:6.1.1';
336337

337338
generator.log(`kafkaVersion=${generator.kafkaVersion}`);
338339
generator.log(`dockerComposeFormatVersion=${generator.dockerComposeFormatVersion}`);
339340
generator.log(`dockerZookeeper=${generator.dockerZookeeper}`);
340341
generator.log(`dockerKafka=${generator.dockerKafka}`);
341342
generator.log(`dockerAkhq=${generator.dockerAkhq}`);
343+
generator.log(`dockerSchemaRegistry=${generator.dockerSchemaRegistry}`);
342344

343345
generator.template('src/main/docker/akhq.yml.ejs', `${jhipsterConstants.MAIN_DIR}docker/akhq.yml`, generator);
344346

347+
// FIXME: Only when choosing Avro schemas in prompts
348+
generator.template('src/main/docker/schema-registry.yml.ejs', `${jhipsterConstants.MAIN_DIR}docker/schema-registry.yml`, generator);
349+
345350
// Related to: https://github.com/jhipster/generator-jhipster/issues/11846
346351
overrideMainGeneratorAppYml(generator);
347352
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '<%= dockerComposeFormatVersion %>'
2+
services:
3+
schema-registry:
4+
image: <%= dockerSchemaRegistry %>
5+
hostname: schema-registry
6+
container_name: schema-registry
7+
ports:
8+
- "8081:8081"
9+
environment:
10+
SCHEMA_REGISTRY_HOST_NAME: schema-registry
11+
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: "zookeeper:2181"

0 commit comments

Comments
 (0)