Skip to content

Commit

Permalink
fix: extract akhq service and remove kafka.yml.ejs (#60)
Browse files Browse the repository at this point in the history
* fix: extract akhq service and remove kafka.yml.ejs

* fix: update port and fix an image tag

* fix: use 11817 (K H Q) as port

closes #58
  • Loading branch information
fdelbrayelle authored May 27, 2020
1 parent 92a48d2 commit 88236a1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 41 deletions.
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.

0 comments on commit 88236a1

Please sign in to comment.