Skip to content

Commit a5df4b3

Browse files
committed
Drop messages v1
1 parent 7be3325 commit a5df4b3

File tree

4 files changed

+31
-140
lines changed

4 files changed

+31
-140
lines changed

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

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,11 @@
66
import static io.kafbat.ui.model.rbac.permission.TopicAction.MESSAGES_READ;
77

88
import io.kafbat.ui.api.MessagesApi;
9-
import io.kafbat.ui.exception.ValidationException;
109
import io.kafbat.ui.model.ConsumerPosition;
1110
import io.kafbat.ui.model.CreateTopicMessageDTO;
1211
import io.kafbat.ui.model.MessageFilterIdDTO;
1312
import io.kafbat.ui.model.MessageFilterRegistrationDTO;
14-
import io.kafbat.ui.model.MessageFilterTypeDTO;
1513
import io.kafbat.ui.model.PollingModeDTO;
16-
import io.kafbat.ui.model.SeekDirectionDTO;
17-
import io.kafbat.ui.model.SeekTypeDTO;
1814
import io.kafbat.ui.model.SerdeUsageDTO;
1915
import io.kafbat.ui.model.SmartFilterTestExecutionDTO;
2016
import io.kafbat.ui.model.SmartFilterTestExecutionResultDTO;
@@ -73,25 +69,8 @@ public Mono<ResponseEntity<SmartFilterTestExecutionResultDTO>> executeSmartFilte
7369
.map(ResponseEntity::ok);
7470
}
7571

76-
@Deprecated
7772
@Override
78-
public Mono<ResponseEntity<Flux<TopicMessageEventDTO>>> getTopicMessages(String clusterName,
79-
String topicName,
80-
SeekTypeDTO seekType,
81-
List<String> seekTo,
82-
Integer limit,
83-
String q,
84-
MessageFilterTypeDTO filterQueryType,
85-
SeekDirectionDTO seekDirection,
86-
String keySerde,
87-
String valueSerde,
88-
ServerWebExchange exchange) {
89-
throw new ValidationException("Not supported");
90-
}
91-
92-
93-
@Override
94-
public Mono<ResponseEntity<Flux<TopicMessageEventDTO>>> getTopicMessagesV2(String clusterName, String topicName,
73+
public Mono<ResponseEntity<Flux<TopicMessageEventDTO>>> getTopicMessages(String clusterName, String topicName,
9574
PollingModeDTO mode,
9675
List<Integer> partitions,
9776
Integer limit,

api/src/test/java/io/kafbat/ui/KafkaConsumerTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void shouldDeleteRecords() {
5656
}
5757

5858
long count = webTestClient.get()
59-
.uri("/api/clusters/{clusterName}/topics/{topicName}/messages/v2?mode=EARLIEST", LOCAL, topicName)
59+
.uri("/api/clusters/{clusterName}/topics/{topicName}/messages?mode=EARLIEST", LOCAL, topicName)
6060
.accept(TEXT_EVENT_STREAM)
6161
.exchange()
6262
.expectStatus()
@@ -77,7 +77,7 @@ public void shouldDeleteRecords() {
7777
.isOk();
7878

7979
count = webTestClient.get()
80-
.uri("/api/clusters/{clusterName}/topics/{topicName}/messages/v2?mode=EARLIEST", LOCAL, topicName)
80+
.uri("/api/clusters/{clusterName}/topics/{topicName}/messages?mode=EARLIEST", LOCAL, topicName)
8181
.exchange()
8282
.expectStatus()
8383
.isOk()

contract/src/main/resources/swagger/kafbat-ui-api.yaml

Lines changed: 27 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -662,33 +662,45 @@ paths:
662662
required: true
663663
schema:
664664
type: string
665-
- name: seekType
665+
- name: mode
666666
in: query
667+
description: Messages polling mode
667668
schema:
668-
$ref: "#/components/schemas/SeekType"
669-
- name: seekTo
669+
$ref: "#/components/schemas/PollingMode"
670+
- name: partitions
670671
in: query
671672
schema:
672673
type: array
674+
description: List of target partitions (all partitions if not provided)
673675
items:
674-
type: string
675-
description: The format is [partition]::[offset] for specifying offsets or [partition]::[timestamp in millis] for specifying timestamps
676+
type: integer
676677
- name: limit
677678
in: query
679+
description: Max number of messages can be returned
678680
schema:
679681
type: integer
680-
- name: q
682+
- name: stringFilter
681683
in: query
684+
description: query string to contains string filtration
682685
schema:
683686
type: string
684-
- name: filterQueryType
687+
- name: smartFilterId
685688
in: query
689+
description: filter id, that was registered beforehand
686690
schema:
687-
$ref: "#/components/schemas/MessageFilterType"
688-
- name: seekDirection
691+
type: string
692+
- name: offset
689693
in: query
694+
description: message offset to read from / to
690695
schema:
691-
$ref: "#/components/schemas/SeekDirection"
696+
type: integer
697+
format: int64
698+
- name: timestamp
699+
in: query
700+
description: timestamp (in ms) to read from / to
701+
schema:
702+
type: integer
703+
format: int64
692704
- name: keySerde
693705
in: query
694706
description: "Serde that should be used for deserialization. Will be chosen automatically if not set."
@@ -699,6 +711,11 @@ paths:
699711
description: "Serde that should be used for deserialization. Will be chosen automatically if not set."
700712
schema:
701713
type: string
714+
- name: cursor
715+
in: query
716+
description: "id of the cursor for pagination, if passed - all other query params ignored"
717+
schema:
718+
type: string
702719
responses:
703720
200:
704721
description: OK
@@ -793,89 +810,6 @@ paths:
793810
schema:
794811
$ref: '#/components/schemas/MessageFilterId'
795812

796-
797-
/api/clusters/{clusterName}/topics/{topicName}/messages/v2:
798-
get:
799-
tags:
800-
- Messages
801-
summary: getTopicMessagesV2
802-
operationId: getTopicMessagesV2
803-
parameters:
804-
- name: clusterName
805-
in: path
806-
required: true
807-
schema:
808-
type: string
809-
- name: topicName
810-
in: path
811-
required: true
812-
schema:
813-
type: string
814-
- name: mode
815-
in: query
816-
description: Messages polling mode
817-
schema:
818-
$ref: "#/components/schemas/PollingMode"
819-
- name: partitions
820-
in: query
821-
schema:
822-
type: array
823-
description: List of target partitions (all partitions if not provided)
824-
items:
825-
type: integer
826-
- name: limit
827-
in: query
828-
description: Max number of messages can be returned
829-
schema:
830-
type: integer
831-
- name: stringFilter
832-
in: query
833-
description: query string to contains string filtration
834-
schema:
835-
type: string
836-
- name: smartFilterId
837-
in: query
838-
description: filter id, that was registered beforehand
839-
schema:
840-
type: string
841-
- name: offset
842-
in: query
843-
description: message offset to read from / to
844-
schema:
845-
type: integer
846-
format: int64
847-
- name: timestamp
848-
in: query
849-
description: timestamp (in ms) to read from / to
850-
schema:
851-
type: integer
852-
format: int64
853-
- name: keySerde
854-
in: query
855-
description: "Serde that should be used for deserialization. Will be chosen automatically if not set."
856-
schema:
857-
type: string
858-
- name: valueSerde
859-
in: query
860-
description: "Serde that should be used for deserialization. Will be chosen automatically if not set."
861-
schema:
862-
type: string
863-
- name: cursor
864-
in: query
865-
description: "id of the cursor for pagination, if passed - all other query params ignored"
866-
schema:
867-
type: string
868-
responses:
869-
200:
870-
description: OK
871-
content:
872-
text/event-stream:
873-
schema:
874-
type: array
875-
items:
876-
$ref: '#/components/schemas/TopicMessageEvent'
877-
878-
879813
/api/clusters/{clusterName}/topics/{topicName}/activeproducers:
880814
get:
881815
tags:
@@ -3080,14 +3014,6 @@ components:
30803014
- offset
30813015
- timestamp
30823016

3083-
SeekType:
3084-
type: string
3085-
enum:
3086-
- BEGINNING
3087-
- OFFSET
3088-
- TIMESTAMP
3089-
- LATEST
3090-
30913017
MessageFilterRegistration:
30923018
type: object
30933019
properties:
@@ -3111,20 +3037,6 @@ components:
31113037
- EARLIEST
31123038
- TAILING
31133039

3114-
MessageFilterType:
3115-
type: string
3116-
enum:
3117-
- STRING_CONTAINS
3118-
- CEL_SCRIPT
3119-
3120-
SeekDirection:
3121-
type: string
3122-
enum:
3123-
- FORWARD
3124-
- BACKWARD
3125-
- TAILING
3126-
default: FORWARD
3127-
31283040
Partition:
31293041
type: object
31303042
properties:

frontend/src/lib/hooks/api/topicMessages.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const useTopicMessages = ({
6060

6161
const url = `${BASE_PARAMS.basePath}/api/clusters/${encodeURIComponent(
6262
clusterName
63-
)}/topics/${topicName}/messages/v2`;
63+
)}/topics/${topicName}/messages`;
6464

6565
const requestParams = new URLSearchParams({
6666
limit: searchParams.get(MessagesFilterKeys.limit) || MESSAGES_PER_PAGE,

0 commit comments

Comments
 (0)