Skip to content

Commit 75d5fd5

Browse files
authored
Merge pull request #50 from tchiotludo/dev
Release 0.6.0
2 parents a185d0c + 852a4b0 commit 75d5fd5

34 files changed

+1263
-111
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ logs/*
3737

3838
### Kafka HQ ###
3939
src/**/*-dev.yml
40+
connects-plugins/
4041

4142
## Docker
4243
.env

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# KafkaHQ
22
[![Build Status](https://travis-ci.org/tchiotludo/kafkahq.svg?branch=master)](https://travis-ci.org/tchiotludo/kafkahq)
33

4-
> Kafka GUI for topics, topics data, consumers group, schema registry and more...
4+
> Kafka GUI for topics, topics data, consumers group, schema registry, connect and more...
55
66

77
![preview](https://user-images.githubusercontent.com/2064609/50536651-e050de80-0b56-11e9-816f-9d3aca3f1c88.gif)
@@ -40,10 +40,12 @@
4040
- Update consumer group offsets to start / end / timestamp
4141
- **Schema Registry**
4242
- List schema
43-
- Create a schema
44-
- Update a schema
45-
- Delete a schema
43+
- Create / Update / Delete a schema
4644
- View and delete individual schema version
45+
- **Connect**
46+
- List connect definition
47+
- Create / Update / Delete a definition
48+
- Pause / Resume / Restart a definition or a task
4749
- **Nodes**
4850
- List
4951
- Configurations view
@@ -94,6 +96,7 @@ file example can be found here :[application.example.yml](application.example.ym
9496
* `key`: must be an url friendly string the identify your cluster (`my-cluster-1` and `my-cluster-2` is the example above)
9597
* `properties`: all the configurations found on [Kafka consumer documentation](https://kafka.apache.org/documentation/#consumerconfigs). Most important is `bootstrap.servers` that is a list of host:port of your Kafka brokers.
9698
* `schema-registry`: the schema registry url *(optional)*
99+
* `connect`: connect url *(optional)*
97100

98101
### Security
99102
* `kafkahq.security.default-roles`: Roles available for all the user even unlogged user, roles available are :
@@ -128,6 +131,7 @@ kafkahq:
128131
- topic/data/read
129132
- group/read
130133
- registry/read
134+
- connect/read
131135
```
132136
133137
@@ -138,7 +142,9 @@ kafkahq:
138142
* `roles`: Role for current users
139143

140144
### Server
141-
* `kafkahq.server.base-path`: if behind a reverse proxy, path to kafkahq with trailing slash
145+
* `kafkahq.server.base-path`: if behind a reverse proxy, path to kafkahq with trailing slash (optional). Example:
146+
kafkahq is behind a reverse proxy with url http://my-server/kafkahq, set base-path: "/kafkahq/". Not needed if you're
147+
behind a reverse proxy with subdomain http://kafkahq.my-server/
142148

143149
### Kafka admin / producer / consumer default properties
144150
* `kafkahq.clients-defaults.{{admin|producer|consumer}}.properties`: if behind a reverse proxy, path to kafkahq with

application.example.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ kafkahq:
1616

1717
# list of kafka cluster available for kafkahq
1818
connections:
19-
my-cluster-1: # url friendly name for the cluster
19+
my-cluster-plain-text: # url friendly name for the cluster
2020
properties: # standard kafka properties (optional)
2121
bootstrap.servers: "kafka:9092"
2222
schema-registry: "http://schema-registry:8085" # schema registry url (optional)
23+
connect: "http://connect:8083" # connect url (optional)
2324

24-
my-cluster-2:
25+
my-cluster-ssl:
2526
properties:
2627
bootstrap.servers: "kafka:9093"
2728
security.protocol: SSL
@@ -31,7 +32,7 @@ kafkahq:
3132
ssl.keystore.password: password
3233
ssl.key.password: password
3334

34-
my-cluster-3:
35+
my-cluster-sasl:
3536
properties:
3637
bootstrap.servers: "kafka:9094"
3738
security.protocol: SASL_SSL
@@ -69,6 +70,11 @@ kafkahq:
6970
- registry/update
7071
- registry/delete
7172
- registry/version/delete
73+
- connect/read
74+
- connect/insert
75+
- connect/update
76+
- connect/delete
77+
- connect/state/update
7278

7379
# Basic auth configuration
7480
basic-auth:

build.gradle

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
buildscript {
22
ext {
3-
micronautVersion = "1.1.0"
3+
micronautVersion = "1.1.+"
44
confluentVersion = "5.1.+"
55
kafkaVersion = "2.2.+"
66
}
@@ -61,13 +61,14 @@ idea {
6161
}
6262
}
6363

64-
configurations {
65-
implementation {
66-
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
67-
exclude group: 'log4j', module: 'log4j'
68-
}
64+
configurations.all {
65+
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
66+
exclude group: 'org.apache.logging.log4j', module: 'log4j-slf4j-impl'
67+
exclude group: 'org.apache.logging.log4j', module: 'log4j-core'
68+
exclude group: 'org.apache.logging.log4j', module: 'log4j-api'
6969
}
7070

71+
7172
/**********************************************************************************************************************\
7273
* Micronaut
7374
**********************************************************************************************************************/
@@ -125,6 +126,11 @@ dependencies {
125126
compile group: "io.confluent", name: "kafka-schema-registry-client", version: confluentVersion
126127
compile group: "io.confluent", name: "kafka-avro-serializer", version: confluentVersion
127128
compile group: 'org.apache.avro', name: 'avro', version: '1.8.2'
129+
compile group: 'org.sourcelab', name: 'kafka-connect-client', version: '2.0.+'
130+
131+
// log
132+
compile group: 'org.slf4j', name: 'jul-to-slf4j', version: '1.8.+'
133+
compile group: 'org.slf4j', name: 'log4j-over-slf4j', version: '1.7.26'
128134

129135
// utils
130136
compileOnly group: "org.projectlombok", name: "lombok", version: "1.18.+"
@@ -143,9 +149,12 @@ dependencies {
143149
testCompile "org.apache.kafka:kafka_2.12:" + kafkaVersion
144150
testCompile "io.confluent:kafka-schema-registry:" + confluentVersion
145151
testCompile "io.confluent:kafka-schema-registry:" + confluentVersion + ":tests"
152+
testCompile "org.apache.kafka:connect-runtime:" + kafkaVersion
153+
testCompile "org.apache.kafka:connect-file:" + kafkaVersion
154+
146155
testCompile group: 'org.apache.kafka', name: 'kafka-streams', version: kafkaVersion
147156
testCompile group: "io.confluent", name: "kafka-streams-avro-serde", version: confluentVersion
148-
testCompile group: 'org.slf4j', name: 'jul-to-slf4j', version: '1.8.+'
157+
testCompile "io.confluent:kafka-connect-avro-converter:" + confluentVersion
149158
testCompile group: 'commons-codec', name: 'commons-codec', version: '1.11'
150159
testImplementation 'org.hamcrest:hamcrest:2.1'
151160
testImplementation 'org.hamcrest:hamcrest-library:2.1'

docker-compose-dev.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,16 @@ services:
9595
CONNECT_GROUP_ID: "kafka-connect"
9696
CONNECT_KEY_CONVERTER_SCHEMAS_ENABLE: "true"
9797
CONNECT_KEY_CONVERTER: io.confluent.connect.avro.AvroConverter
98-
CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
98+
CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8085
9999
CONNECT_VALUE_CONVERTER_SCHEMAS_ENABLE: "true"
100100
CONNECT_VALUE_CONVERTER: io.confluent.connect.avro.AvroConverter
101-
CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
101+
CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8085
102102
CONNECT_INTERNAL_KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter
103103
CONNECT_INTERNAL_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter
104104
CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 1
105105
CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 1
106106
CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: 1
107107
CONNECT_PLUGIN_PATH: ' /usr/share/java/'
108+
volumes:
109+
- ./connects-plugins:/usr/share/java/connects-plugins
110+

package-lock.json

Lines changed: 30 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/org/kafkahq/configs/Connection.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
@Getter
1212
public class Connection extends AbstractProperties {
1313
Optional<URL> schemaRegistry = Optional.empty();
14+
Optional<URL> connect = Optional.empty();
1415

1516
public Connection(@Parameter String name) {
1617
super(name);

src/main/java/org/kafkahq/configs/Role.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@ public class Role {
2222
public static final String ROLE_REGISTRY_UPDATE = "registry/update";
2323
public static final String ROLE_REGISTRY_DELETE = "registry/delete";
2424
public static final String ROLE_REGISTRY_VERSION_DELETE = "registry/version/delete";
25+
26+
public static final String ROLE_CONNECT_READ = "connect/read";
27+
public static final String ROLE_CONNECT_INSERT = "connect/insert";
28+
public static final String ROLE_CONNECT_UPDATE = "connect/update";
29+
public static final String ROLE_CONNECT_DELETE = "connect/delete";
30+
public static final String ROLE_CONNECT_STATE_UPDATE = "connect/state/update";
2531
}

src/main/java/org/kafkahq/controllers/AbstractController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ protected Map templateData(Optional<String> cluster, Object... values) {
5454
cluster.ifPresent(s -> {
5555
datas.put("clusterId", s);
5656
datas.put("registryEnabled", this.kafkaModule.getRegistryRestClient(s) != null);
57+
datas.put("connectEnabled", this.kafkaModule.getConnectRestClient(s) != null);
5758
});
5859

5960
if (applicationContext.containsBean(SecurityService.class)) {
@@ -129,7 +130,7 @@ private static List<String> expandRoles(List<String> roles) {
129130
}
130131

131132
@SuppressWarnings("unchecked")
132-
private List<String> getRights() {
133+
protected List<String> getRights() {
133134
if (!applicationContext.containsBean(SecurityService.class)) {
134135
return expandRoles(this.defaultRoles);
135136
}

0 commit comments

Comments
 (0)