Skip to content

Commit

Permalink
Merge branch 'dev' into my-dev
Browse files Browse the repository at this point in the history
* dev: (62 commits)
  chore(docker): add unless-stopped (tchiotludo#1445)
  fix(connect): sort throw exception (tchiotludo#1431)
  chore(build): add idea-ext on build.gradle (tchiotludo#1446)
  fix(topicdata): no topic data when 1 record with newest sort  (tchiotludo#1466)
  fix(topicdata): search can failed data pagination with many results (tchiotludo#1468)
  chore(schema): typos
  chore(version): update to 0.24.0
  chore(deps): update java deps
  fix(ui): fixing logo not showing on login form (tchiotludo#1449)
  fix(ui): fixing data download inconsistencies on JSON and CSV format (tchiotludo#1442)
  chore(docs): add GrtGaz as AKHQ user (tchiotludo#1439)
  feat(ui): download all messages in a topic to a csv file (tchiotludo#1384)
  fix(ui): clicking on Empty Topic button display blank screen (tchiotludo#1429)
  chore(landing): add baloise logo (tchiotludo#1427)
  fix(ui): don't disabled empty for compact,delete topic
  chore(deps): update all java deps
  fix(topicdata): Use the partition leader from partition info (tchiotludo#1388)
  fix(ui):  harmonize utc labels (tchiotludo#1403)
  fix(ui): fix produce multi / tombstone not working and forms layout issue (tchiotludo#1396)
  fix(auth): fix regex header string for long strim (tchiotludo#1402)
  ...

# Conflicts:
#	.env
#	build.gradle
#	client/src/containers/Topic/Topic/TopicData/TopicData.jsx
#	gradle.properties
#	helm/akhq/Chart.yaml
#	src/main/java/org/akhq/controllers/SchemaController.java
#	src/test/java/org/akhq/controllers/KsqlDbControllerTest.java
#	src/test/java/org/akhq/repositories/KsqlDbRepositoryTest.java
  • Loading branch information
markush81 committed May 1, 2023
2 parents 78fa68d + ca1dce3 commit fa0c750
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
CONFLUENT_VERSION=7.3.2
CONFLUENT_KAFKACAT_VERSION=7.1.6 # seems there is not a release with each version
CONFLUENT_VERSION=7.3.3
CONFLUENT_KAFKACAT_VERSION=7.1.7 # seems there is not a release with each version
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Kestra is an infinitely scalable orchestration and scheduling platform, creating
* [BPCE-IT](https://www.bpce-it.fr/)
* [Decathlon](https://www.decathlon.fr/)
* [Depop](https://www.depop.com)
* [Doximity](https://www.doximity.com)
* [Fresha](https://www.fresha.com/)
* [Galeries Lafayette](https://www.galerieslafayette.com/)
* [GetYourGuide](https://www.getyourguide.com)
Expand Down
8 changes: 3 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
// micronaut
id "com.github.johnrengelman.shadow" version "8.1.0"
id "com.github.johnrengelman.shadow" version "8.1.1"
id "io.micronaut.application" version "3.7.5"

// akhq
Expand All @@ -16,7 +16,7 @@ plugins {
}

group "org.akhq"
version "0.23.0"
version "0.24.0"
mainClassName = "org.akhq.App"
sourceCompatibility = 11

Expand Down Expand Up @@ -48,7 +48,6 @@ configurations.all {
}
}


/**********************************************************************************************************************\
* IntelliJ IDEA
**********************************************************************************************************************/
Expand Down Expand Up @@ -140,7 +139,7 @@ dependencies {
// Password hashing
implementation group: "org.mindrot", name: "jbcrypt", version: "0.4"

implementation group: 'org.codehaus.groovy', name: 'groovy-all', version: '3.0.16'
implementation group: 'org.codehaus.groovy', name: 'groovy-all', version: '3.0.17'
// api

// client
Expand Down Expand Up @@ -255,4 +254,3 @@ shadowJar {
processResources.dependsOn ":client:installFrontend"
processResources.dependsOn ":client:assembleFrontend"
processResources.dependsOn ":client:copyClientResources"

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "akhq-front-end",
"version": "0.23.0",
"version": "0.24.0",
"private": true,
"homepage": "./ui",
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions client/src/containers/Login/Login.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import logo from '../../images/logo.svg';
import { ReactComponent as Logo } from '../../images/logo.svg';
import { uriCurrentUser, uriLogin, uriOidc } from '../../utils/endpoints';
import { organizeRoles } from '../../utils/converters';
import { login } from '../../utils/api';
Expand Down Expand Up @@ -172,7 +172,7 @@ class Login extends Form {
>
<div>
<h3 className="logo">
<img src={logo} alt="" />
<Logo />
</h3>
</div>
{formEnabled && this._renderForm()}
Expand Down
9 changes: 5 additions & 4 deletions client/src/containers/Topic/Topic/TopicData/TopicData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,13 @@ class TopicData extends Root {
this.eventSource.addEventListener('searchBody', function (e) {
const res = JSON.parse(e.data);
const records = res.records || [];
const nextPage = res.after ? res.after : self.state.nextPage;

const percentDiff = res.percent - lastPercentVal;

// to avoid UI slowdowns, only update the percentage in fixed increments
if (percentDiff >= percentUpdateDelta) {
lastPercentVal = res.percent;
self.setState({
nextPage,
recordCount: self.state.recordCount + records.length,
percent: res.percent.toFixed(2)
});
Expand All @@ -207,9 +205,12 @@ class TopicData extends Root {
}
});

this.eventSource.addEventListener('searchEnd', function () {
this.eventSource.addEventListener('searchEnd', function (e) {
const res = JSON.parse(e.data);
const nextPage = res.after ? res.after : self.state.nextPage;
self.setState({ percent: 100, nextPage, isSearching: false, loading: false });

self.eventSource.close();
self.setState({ percent: 100, isSearching: false, loading: false });
});
}
);
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
micronautVersion=3.8.7
confluentVersion=7.3.2
micronautVersion=3.8.8
confluentVersion=7.3.3
kafkaVersion=3.4.0
kafkaScalaVersion=2.13
lombokVersion=1.18.26
4 changes: 2 additions & 2 deletions helm/akhq/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
appVersion: "0.23.0"
appVersion: "0.24.0"
description: Kafka GUI for Apache Kafka to manage topics, topics data, consumers group, schema registry, connect and more...
name: akhq
version: 0.3.1
version: 0.24.0
keywords:
- kafka
- confluent
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/akhq/controllers/SchemaController.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public Schema create(
@Body Schema schema
) throws Throwable {
if (this.schemaRepository.exist(cluster, schema.getSubject())) {
throw new IllegalArgumentException("Subject '" + schema.getSubject() + "' already exits");
throw new IllegalArgumentException("Subject '" + schema.getSubject() + "' already exists");
}

return registerSchema(cluster, schema);
Expand All @@ -107,11 +107,11 @@ public Schema home(HttpRequest<?> request, String cluster, String subject) throw
public Schema updateSchema(String cluster, String subject, @Body Schema schema) throws Throwable {
final String decodedSubject = decode(subject);
if (!this.schemaRepository.exist(cluster, decodedSubject)) {
throw new IllegalArgumentException("Subject '" + decodedSubject + "' doesn't exits");
throw new IllegalArgumentException("Subject '" + decodedSubject + "' doesn't exist");
}

if (!decodedSubject.equals(schema.getSubject())) {
throw new IllegalArgumentException("Invalid subject name '" + decodedSubject + "', doesn't egals '" + schema.getSubject() + "'");
throw new IllegalArgumentException("Invalid subject name '" + decodedSubject + "', doesn't match '" + schema.getSubject() + "'");
}

return registerSchema(cluster, schema);
Expand Down Expand Up @@ -155,9 +155,9 @@ public List<Schema> versions(HttpRequest<?> request, String cluster, String subj
@Delete("api/{cluster}/schema/{subject}")
@Operation(tags = {"schema registry"}, summary = "Delete a schema")
public HttpResponse<?> delete(String cluster, String subject) throws IOException, RestClientException {
final String decodedSubject = decode(subject);
final String decodedSubject = decode(subject);
if (!this.schemaRepository.exist(cluster, decodedSubject)) {
throw new IllegalArgumentException("Subject '" + decodedSubject + "' doesn't exits");
throw new IllegalArgumentException("Subject '" + decodedSubject + "' doesn't exist");
}

this.schemaRepository.delete(cluster, decodedSubject);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/akhq/models/ConnectPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public ConnectPlugin(ConnectorPlugin connectorPlugin, ConnectorPluginConfigValid
.map(config -> new Definition(config.getDefinition())),
registryDefinition()
)
.sorted(Comparator.comparing(Definition::getGroup, (s1, s2) -> s1.equals("Others") ? 1 : s1.compareTo(s2))
.sorted(Comparator.comparing(Definition::getGroup, Comparator.comparing((String s) -> s.equals("Others"))
.thenComparing(Comparator.naturalOrder()))
.thenComparing(Definition::getOrder)
)
.collect(Collectors.toList());
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/akhq/repositories/RecordRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ private Optional<EndOffsetBound> getOffsetForSortNewest(KafkaConsumer<byte[], by
last = options.after.get(partition.getId()) - 1;
}

if (last == partition.getFirstOffset() || last < 0) {
if (last < 0) {
consumer.close();
return null;
} else if (!(last - pollSizePerPartition < first)) {
Expand Down Expand Up @@ -683,8 +683,7 @@ public Flowable<Event<SearchEvent>> search(Topic topic, Options options) throws

// end
if (searchEvent == null || searchEvent.emptyPoll == 666) {

emitter.onNext(new SearchEvent(topic).end());
emitter.onNext(new SearchEvent(topic).end(searchEvent != null ? searchEvent.after: null));
emitter.onComplete();
consumer.close();

Expand Down Expand Up @@ -725,7 +724,7 @@ public Flowable<Event<SearchEvent>> search(Topic topic, Options options) throws

if (currentEvent.emptyPoll >= 1) {
currentEvent.emptyPoll = 666;
emitter.onNext(currentEvent.end());
emitter.onNext(currentEvent.end(searchEvent.getAfter()));
} else if (matchesCount.get() >= options.getSize()) {
currentEvent.emptyPoll = 666;
emitter.onNext(currentEvent.progress(options));
Expand Down Expand Up @@ -860,8 +859,9 @@ private SearchEvent(Topic topic) {
});
}

public Event<SearchEvent> end() {
public Event<SearchEvent> end(String after) {
this.percent = 100;
this.after = after;

return Event.of(this).name("searchEnd");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class KsqlDbControllerTest extends AbstractTest {
void info() {
KsqlDbServerInfo serverInfo = this.retrieve(HttpRequest.GET(BASE_URL + "/info"), KsqlDbServerInfo.class);
assertNotNull(serverInfo.getKafkaClusterId());
assertEquals("7.3.2", serverInfo.getServerVersion());
assertEquals("7.3.3", serverInfo.getServerVersion());
assertEquals("ksql", serverInfo.getKsqlServiceId());
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/akhq/controllers/SchemaControllerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void crud() {
this.retrieve(HttpRequest.POST(BASE_URL, SCHEMA_1_V1), Schema.class);
}
);
assertTrue(e.getMessage().contains("already exits"));
assertTrue(e.getMessage().contains("already exists"));

// update
result = this.retrieve(HttpRequest.POST(BASE_URL + "/" + SCHEMA_1_V1.getSubject(), SCHEMA_1_V2), Schema.class);
Expand Down Expand Up @@ -102,6 +102,6 @@ void deleteNotExistApi() {
);
}
);
assertTrue(e.getMessage().contains("doesn't exits"));
assertTrue(e.getMessage().contains("doesn't exist"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void cleanup() {
void getServerInfo() {
KsqlDbServerInfo serverInfo = repository.getServerInfo(KafkaTestCluster.CLUSTER_ID, "ksqldb");
assertNotNull(serverInfo.getKafkaClusterId());
assertEquals("7.3.2", serverInfo.getServerVersion());
assertEquals("7.3.3", serverInfo.getServerVersion());
assertEquals("ksql", serverInfo.getKsqlServiceId());
}

Expand Down

0 comments on commit fa0c750

Please sign in to comment.