Skip to content

Commit 7479f01

Browse files
authored
Merge branch 'main' into issues/688
2 parents 8c13134 + 0af059b commit 7479f01

File tree

102 files changed

+2105
-903
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+2105
-903
lines changed

README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,28 +72,25 @@ Kafbat UI wraps major functions of Apache Kafka with an intuitive user interface
7272
![Interface](documentation/images/Interface.gif)
7373

7474
## Topics
75-
Kafbat UI makes it easy for you to create topics in your browser by several clicks,
76-
pasting your own parameters, and viewing topics in the list.
75+
Kafbat UI makes it easy for you to create topics in your browser with just a few clicks, by pasting your own parameters, and viewing topics in the list.
7776

7877
![Create Topic](documentation/images/Create_topic_kafka-ui.gif)
7978

80-
It's possible to jump from connectors view to corresponding topics and from a topic to consumers (back and forth) for more convenient navigation.
81-
connectors, overview topic settings.
79+
You can jump from the connectors view to corresponding topics and from a topic to consumers (back and forth) for more convenient navigation, including connectors and overview topic settings.
8280

8381
![Connector_Topic_Consumer](documentation/images/Connector_Topic_Consumer.gif)
8482

8583
### Messages
86-
Let's say we want to produce messages for our topic. With the Kafbat UI we can send or write data/messages to the Kafka topics without effort by specifying parameters, and viewing messages in the list.
84+
Suppose you want to produce messages for your topic. With Kafbat UI, you can easily send or write data/messages to Kafka topics by specifying parameters and viewing messages in the list.
8785

8886
![Produce Message](documentation/images/Create_message_kafka-ui.gif)
8987

9088
## Schema registry
91-
There are 3 supported types of schemas: Avro®, JSON Schema, and Protobuf schemas.
89+
There are three supported types of schemas: Avro®, JSON Schema, and Protobuf schemas.
9290

9391
![Create Schema Registry](documentation/images/Create_schema.gif)
9492

95-
Before producing avro/protobuf encoded messages, you have to add a schema for the topic in Schema Registry. Now all these steps are easy to do
96-
with a few clicks in a user-friendly interface.
93+
Before producing Avro/Protobuf encoded messages, you need to add a schema for the topic in the Schema Registry. All these steps are now easy to do with just a few clicks in a user-friendly interface.
9794

9895
![Avro Schema Topic](documentation/images/Schema_Topic.gif)
9996

@@ -111,7 +108,7 @@ docker run -it -p 8080:8080 -e DYNAMIC_CONFIG_ENABLED=true ghcr.io/kafbat/kafka-
111108

112109
Then access the web UI at [http://localhost:8080](http://localhost:8080)
113110

114-
The command is sufficient to try things out. When you're done trying things out, you can proceed with a [persistent installation](https://ui.docs.kafbat.io/quick-start/persistent-start)
111+
This command is sufficient to try things out. When you're done, you can proceed with a [persistent installation](https://ui.docs.kafbat.io/quick-start/persistent-start).
115112

116113
## Persistent installation
117114

@@ -146,24 +143,24 @@ Please refer to our [configuration](https://ui.docs.kafbat.io/configuration/conf
146143
147144
## Building from sources
148145
149-
[Quick start](https://ui.docs.kafbat.io/development/building/prerequisites) with building
146+
[Quick start](https://ui.docs.kafbat.io/development/building/prerequisites) for building from source
150147
151148
## Liveliness and readiness probes
152-
Liveliness and readiness endpoint is at `/actuator/health`.<br/>
153-
Info endpoint (build info) is located at `/actuator/info`.
149+
The liveness and readiness endpoint is at `/actuator/health`.<br/>
150+
The info endpoint (build info) is located at `/actuator/info`.
154151

155152
# Configuration options
156153

157-
All the environment variables/config properties could be found [here](https://ui.docs.kafbat.io/configuration/misc-configuration-properties).
154+
All environment variables and configuration properties can be found [here](https://ui.docs.kafbat.io/configuration/misc-configuration-properties).
158155

159156
# Contributing
160157

161-
Please refer to [contributing guide](https://ui.docs.kafbat.io/development/contributing), we'll guide you from there.
158+
Please refer to the [contributing guide](https://ui.docs.kafbat.io/development/contributing); we'll guide you from there.
162159

163160
# Support
164161

165162
As we're fully independent, team members contribute in their free time.
166-
Your support is crucial for us, if you wish to sponsor us, take a look [here](https://github.com/sponsors/kafbat)
163+
Your support is crucial for us, if you wish to sponsor us, take a look [here](https://github.com/sponsors/kafbat)
167164

168165
# Powered by
169166

api/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The tag is ignored when a sha is included but the reason to add it are:
22
# 1. Self Documentation: It is difficult to find out what the expected tag is given a sha alone
33
# 2. Helps dependabot during discovery of upgrades
4-
FROM azul/zulu-openjdk-alpine:21.0.8-jre-headless@sha256:9c7b4b7850bd4cdd78f91b369accc5b55beffa9a073b9a2bb94caa42606b9444
4+
FROM azul/zulu-openjdk-alpine:21.0.8-jre-headless@sha256:49992ca94d08736b6827ad3289114acc7934a0da543f3bff208c3df46ed1108c
55

66
RUN apk add --no-cache \
77
# snappy codec

api/src/main/java/io/kafbat/ui/client/RetryingKafkaConnectClient.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
import io.kafbat.ui.connect.ApiClient;
88
import io.kafbat.ui.connect.api.KafkaConnectClientApi;
99
import io.kafbat.ui.connect.model.Connector;
10+
import io.kafbat.ui.connect.model.ConnectorExpand;
1011
import io.kafbat.ui.connect.model.ConnectorPlugin;
1112
import io.kafbat.ui.connect.model.ConnectorPluginConfigValidationResponse;
1213
import io.kafbat.ui.connect.model.ConnectorStatus;
1314
import io.kafbat.ui.connect.model.ConnectorTask;
1415
import io.kafbat.ui.connect.model.ConnectorTopics;
16+
import io.kafbat.ui.connect.model.ExpandedConnector;
1517
import io.kafbat.ui.connect.model.NewConnector;
1618
import io.kafbat.ui.connect.model.TaskStatus;
1719
import io.kafbat.ui.exception.KafkaConnectConflictResponseException;
@@ -221,13 +223,17 @@ public Mono<ResponseEntity<Map<String, ConnectorTopics>>> getConnectorTopicsWith
221223
}
222224

223225
@Override
224-
public Mono<List<String>> getConnectors(String search) throws WebClientResponseException {
225-
return withRetryOnConflictOrRebalance(super.getConnectors(search));
226+
public Mono<Map<String, ExpandedConnector>> getConnectors(
227+
String search, List<ConnectorExpand> expand
228+
) throws WebClientResponseException {
229+
return withRetryOnConflictOrRebalance(super.getConnectors(search, expand));
226230
}
227231

228232
@Override
229-
public Mono<ResponseEntity<List<String>>> getConnectorsWithHttpInfo(String search) throws WebClientResponseException {
230-
return withRetryOnConflictOrRebalance(super.getConnectorsWithHttpInfo(search));
233+
public Mono<ResponseEntity<Map<String, ExpandedConnector>>> getConnectorsWithHttpInfo(
234+
String search, List<ConnectorExpand> expand
235+
) throws WebClientResponseException {
236+
return withRetryOnConflictOrRebalance(super.getConnectorsWithHttpInfo(search, expand));
231237
}
232238

233239
@Override

api/src/main/java/io/kafbat/ui/config/ClustersProperties.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ public enum LogLevel {
227227
@AllArgsConstructor
228228
public static class CacheProperties {
229229
boolean enabled = true;
230-
Duration connectCacheExpiry = Duration.ofMinutes(1);
231230
Duration connectClusterCacheExpiry = Duration.ofHours(24);
232231
}
233232

@@ -243,11 +242,23 @@ public static class NgramProperties {
243242
@NoArgsConstructor
244243
@AllArgsConstructor
245244
public static class ClusterFtsProperties {
246-
boolean enabled = false;
245+
boolean enabled = true;
246+
boolean defaultEnabled = false;
247247
NgramProperties schemas = new NgramProperties(1, 4);
248248
NgramProperties consumers = new NgramProperties(1, 4);
249249
NgramProperties connect = new NgramProperties(1, 4);
250250
NgramProperties acl = new NgramProperties(1, 4);
251+
252+
public boolean use(Boolean request) {
253+
if (enabled) {
254+
if (Boolean.TRUE.equals(request)) {
255+
return true;
256+
} else if (request == null && defaultEnabled) {
257+
return true;
258+
}
259+
}
260+
return false;
261+
}
251262
}
252263

253264
@PostConstruct

api/src/main/java/io/kafbat/ui/config/McpConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ public McpAsyncServer mcpServer(WebFluxSseServerTransportProvider transport) {
4444
// Configure server capabilities with resource support
4545
var capabilities = McpSchema.ServerCapabilities.builder()
4646
.resources(false, true)
47-
.tools(true) // Tool support with list changes notifications
47+
.tools(true) // Tools support with list changes notifications
4848
.prompts(false) // Prompt support with list changes notifications
4949
.logging() // Logging support
5050
.build();
5151

52-
// Create the server with both tool and resource capabilities
52+
// Create the server with both tools and resource capabilities
5353
return McpServer.async(transport)
5454
.serverInfo("Kafka UI MCP", "0.0.1")
5555
.capabilities(capabilities)

api/src/main/java/io/kafbat/ui/controller/AclsController.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
@RestController
2727
@RequiredArgsConstructor
28-
public class AclsController extends AbstractController implements AclsApi, McpTool {
28+
public class AclsController extends AbstractController implements AclsApi, McpTool {
2929

3030
private final AclsService aclsService;
3131

@@ -69,6 +69,7 @@ public Mono<ResponseEntity<Flux<KafkaAclDTO>>> listAcls(String clusterName,
6969
String resourceName,
7070
KafkaAclNamePatternTypeDTO namePatternTypeDto,
7171
String search,
72+
Boolean fts,
7273
ServerWebExchange exchange) {
7374
AccessContext context = AccessContext.builder()
7475
.cluster(clusterName)
@@ -89,7 +90,7 @@ public Mono<ResponseEntity<Flux<KafkaAclDTO>>> listAcls(String clusterName,
8990
return validateAccess(context).then(
9091
Mono.just(
9192
ResponseEntity.ok(
92-
aclsService.listAcls(getCluster(clusterName), filter, search)
93+
aclsService.listAcls(getCluster(clusterName), filter, search, fts)
9394
.map(ClusterMapper::toKafkaAclDto)))
9495
).doOnEach(sig -> audit(context, sig));
9596
}

api/src/main/java/io/kafbat/ui/controller/ConsumerGroupsController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ public Mono<ResponseEntity<ConsumerGroupsPageResponseDTO>> getConsumerGroupsPage
128128
String search,
129129
ConsumerGroupOrderingDTO orderBy,
130130
SortOrderDTO sortOrderDto,
131+
Boolean fts,
131132
ServerWebExchange exchange) {
132133

133134
var context = AccessContext.builder()

api/src/main/java/io/kafbat/ui/controller/KafkaConnectController.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,12 @@ public Mono<ResponseEntity<Flux<String>>> getConnectors(String clusterName, Stri
6666
.build();
6767

6868
return validateAccess(context)
69-
.thenReturn(ResponseEntity.ok(kafkaConnectService.getConnectorNames(getCluster(clusterName), connectName)))
70-
.doOnEach(sig -> audit(context, sig));
69+
.thenReturn(
70+
ResponseEntity.ok(
71+
kafkaConnectService.getConnectors(getCluster(clusterName), connectName)
72+
.flatMapMany(m -> Flux.fromIterable(m.keySet()))
73+
)
74+
).doOnEach(sig -> audit(context, sig));
7175
}
7276

7377
@Override
@@ -129,6 +133,7 @@ public Mono<ResponseEntity<Flux<FullConnectorInfoDTO>>> getAllConnectors(
129133
String search,
130134
ConnectorColumnsToSortDTO orderBy,
131135
SortOrderDTO sortOrder,
136+
Boolean fts,
132137
ServerWebExchange exchange
133138
) {
134139
var context = AccessContext.builder()
@@ -140,7 +145,7 @@ public Mono<ResponseEntity<Flux<FullConnectorInfoDTO>>> getAllConnectors(
140145
? getConnectorsComparator(orderBy)
141146
: getConnectorsComparator(orderBy).reversed();
142147

143-
Flux<FullConnectorInfoDTO> job = kafkaConnectService.getAllConnectors(getCluster(clusterName), search)
148+
Flux<FullConnectorInfoDTO> job = kafkaConnectService.getAllConnectors(getCluster(clusterName), search, fts)
144149
.filterWhen(dto -> accessControlService.isConnectAccessible(dto.getConnect(), clusterName))
145150
.sort(comparator);
146151

api/src/main/java/io/kafbat/ui/controller/SchemasController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,15 @@ public Mono<ResponseEntity<SchemaSubjectsResponseDTO>> getSchemas(String cluster
217217
@Valid String search,
218218
SchemaColumnsToSortDTO orderBy,
219219
SortOrderDTO sortOrder,
220+
Boolean fts,
220221
ServerWebExchange serverWebExchange) {
221222
var context = AccessContext.builder()
222223
.cluster(clusterName)
223224
.operationName("getSchemas")
224225
.build();
225226

226-
ClustersProperties.ClusterFtsProperties fts = clustersProperties.getFts();
227+
ClustersProperties.ClusterFtsProperties ftsProperties = clustersProperties.getFts();
228+
boolean useFts = ftsProperties.use(fts);
227229

228230
return schemaRegistryService
229231
.getAllSubjectNames(getCluster(clusterName))
@@ -234,7 +236,7 @@ public Mono<ResponseEntity<SchemaSubjectsResponseDTO>> getSchemas(String cluster
234236
int pageSize = perPage != null && perPage > 0 ? perPage : DEFAULT_PAGE_SIZE;
235237
int subjectToSkip = ((pageNum != null && pageNum > 0 ? pageNum : 1) - 1) * pageSize;
236238

237-
SchemasFilter filter = new SchemasFilter(subjects, fts.isEnabled(), fts.getSchemas());
239+
SchemasFilter filter = new SchemasFilter(subjects, useFts, ftsProperties.getSchemas());
238240
List<String> filteredSubjects = new ArrayList<>(filter.find(search));
239241

240242
var totalPages = (filteredSubjects.size() / pageSize)

api/src/main/java/io/kafbat/ui/controller/TopicsController.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,20 +174,22 @@ public Mono<ResponseEntity<TopicsResponseDTO>> getTopics(String clusterName,
174174
@Valid String search,
175175
@Valid TopicColumnsToSortDTO orderBy,
176176
@Valid SortOrderDTO sortOrder,
177+
Boolean fts,
177178
ServerWebExchange exchange) {
178179

179180
AccessContext context = AccessContext.builder()
180181
.cluster(clusterName)
181182
.operationName("getTopics")
182183
.build();
183184

184-
return topicsService.getTopicsForPagination(getCluster(clusterName), search, showInternal)
185+
return topicsService.getTopicsForPagination(getCluster(clusterName), search, showInternal, fts)
185186
.flatMap(topics -> accessControlService.filterViewableTopics(topics, clusterName))
186187
.flatMap(topics -> {
187188
int pageSize = perPage != null && perPage > 0 ? perPage : DEFAULT_PAGE_SIZE;
188189
var topicsToSkip = ((page != null && page > 0 ? page : 1) - 1) * pageSize;
189-
ClustersProperties.ClusterFtsProperties fts = clustersProperties.getFts();
190-
Comparator<InternalTopic> comparatorForTopic = getComparatorForTopic(orderBy, fts.isEnabled());
190+
ClustersProperties.ClusterFtsProperties ftsProperties = clustersProperties.getFts();
191+
boolean useFts = ftsProperties.use(fts);
192+
Comparator<InternalTopic> comparatorForTopic = getComparatorForTopic(orderBy, useFts);
191193
var comparator = sortOrder == null || !sortOrder.equals(SortOrderDTO.DESC)
192194
? comparatorForTopic : comparatorForTopic.reversed();
193195

0 commit comments

Comments
 (0)