Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: extract akhq service and remove kafka.yml.ejs #60

Merged
merged 3 commits into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ Generated consumers should not be explicitly used in other classes as each of th

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

1. Run `docker-compose -f src/main/docker/kafka.yml up -d` to launch the ZooKeeper and Kafka services with AKHQ
1. Go to [http://localhost:8081](http://localhost:8081)
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
1. Go to [http://localhost:11817](http://localhost:11817)
1. Start your application with `./mvnw` to manage your topics and more!

# License
Expand Down
10 changes: 2 additions & 8 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,8 @@ module.exports = class extends BaseGenerator {
const testResourceDir = jhipsterConstants.SERVER_TEST_RES_DIR;
const webappDir = jhipsterConstants.CLIENT_MAIN_SRC_DIR;

this.kafkaVersion = jhipsterConstants.KAFKA_VERSION;
this.dockerComposeFormatVersion = jhipsterConstants.DOCKER_COMPOSE_FORMAT_VERSION;
this.dockerZookeeper = jhipsterConstants.DOCKER_ZOOKEEPER;
this.dockerKafka = jhipsterConstants.DOCKER_KAFKA;
this.dockerAkhq = 'tchiotludo/akhq';
this.dockerAkhq = 'tchiotludo/akhq:0.14.1';

// variables from questions
this.components = this.props.components;
Expand All @@ -264,10 +261,7 @@ module.exports = class extends BaseGenerator {
this.log(`resourceDir=${resourceDir}`);
this.log(`resourceDir=${testResourceDir}`);
this.log(`webappDir=${webappDir}`);
this.log(`kafkaVersion=${this.kafkaVersion}`);
this.log(`dockerComposeFormatVersion=${this.dockerComposeFormatVersion}`);
this.log(`dockerZookeeper=${this.dockerZookeeper}`);
this.log(`dockerKafka=${this.dockerKafka}`);
this.log(`dockerAkhq=${this.dockerAkhq}`);

this.log('\n--- variables from questions ---');
Expand Down Expand Up @@ -355,7 +349,7 @@ module.exports = class extends BaseGenerator {
this.replaceContent(`${resourceDir}config/application.yml`, kafkaBlockPattern, kafkaProperties);
this.replaceContent(`${testResourceDir}config/application.yml`, kafkaBlockPattern, kafkaTestProperties);

this.template('src/main/docker/kafka.yml.ejs', `${jhipsterConstants.MAIN_DIR}docker/kafka.yml`, this, null, null);
this.template('src/main/docker/akhq.yml.ejs', `${jhipsterConstants.MAIN_DIR}docker/akhq.yml`, this, null, null);

// Related to: https://github.com/jhipster/generator-jhipster/issues/11846
this.overrideMainGeneratorAppYml();
Expand Down
15 changes: 15 additions & 0 deletions generators/app/templates/src/main/docker/akhq.yml.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '<%= dockerComposeFormatVersion %>'
services:
akhq:
image: <%= dockerAkhq %>
environment:
AKHQ_CONFIGURATION: |
akhq:
connections:
docker-kafka-server:
properties:
bootstrap.servers: "kafka:29092"
ports:
- 11817:8080
links:
- kafka
31 changes: 0 additions & 31 deletions generators/app/templates/src/main/docker/kafka.yml.ejs

This file was deleted.