Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions docker/latest/management/management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ zookeeper:
storage:
pathPrefix: /run/hermes
clusters:
-
datacenter: dc
clusterName: zk
- datacenter: dc
root: /run/hermes
connectionString: zk:2181

kafka:
clusters:
-
datacenter: dc
- datacenter: dc
clusterName: primary
connectionTimeout: 3000
bootstrapKafkaServer: kafka:29092
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package pl.allegro.tech.hermes.api;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(value = TopicSearchItem.class, name = "TOPIC"),
@JsonSubTypes.Type(value = SubscriptionSearchItem.class, name = "SUBSCRIPTION"),
})
public interface SearchItem {
SearchItemType type();

String name();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package pl.allegro.tech.hermes.api;

public enum SearchItemType {
TOPIC,
SUBSCRIPTION
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package pl.allegro.tech.hermes.api;

import static java.util.Collections.emptyList;

import java.util.List;

public record SearchResults(List<SearchItem> results, long totalCount) {
public static SearchResults empty() {
return new SearchResults(emptyList(), 0);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package pl.allegro.tech.hermes.api;

public record SubscriptionSearchItem(String name, Subscription subscription) implements SearchItem {
@Override
public SearchItemType type() {
return SearchItemType.SUBSCRIPTION;
}

public record Subscription(String endpoint, Topic topic) {}

public record Topic(String name, String qualifiedName, String groupName) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package pl.allegro.tech.hermes.api;

public record TopicSearchItem(String name, Topic topic) implements SearchItem {
@Override
public SearchItemType type() {
return SearchItemType.TOPIC;
}

public record Topic(String groupName, Owner owner) {}

public record Owner(String id) {}
}
2 changes: 1 addition & 1 deletion hermes-console/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.12.0
22.20.0
2 changes: 1 addition & 1 deletion hermes-console/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Hermes console written in Vue 3.

## Requirements

* node >=22.12.0
* node >=22.20.0
* yarn

## Node setup
Expand Down
2 changes: 1 addition & 1 deletion hermes-console/json-server/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -768,4 +768,4 @@
"avroSubscriptionCount": 100
}
}
}
}
3 changes: 2 additions & 1 deletion hermes-console/json-server/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
"/owners/sources/*?search=:searchPhrase": "/topicsOwners?name_like=:searchPhrase",
"/dashboards/topics/:topicName": "/topicDashboardUrl",
"/dashboards/topics/:topicName/subscriptions/:id": "/subscriptionDashboardUrl",
"/inactive-topics": "/inactiveTopics"
"/inactive-topics": "/inactiveTopics",
"/search/query?q=:searchPhrase": "/search"
}
37 changes: 37 additions & 0 deletions hermes-console/json-server/search.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"results": [
{
"type": "TOPIC",
"name": "pl.allegro.public.group.DummyEvent",
"topic": {
"groupName": "pl.allegro.public.group",
"owner": {
"id": "1234"
}
}
},
{
"type": "SUBSCRIPTION",
"name": "foobar-service",
"subscription": {
"topic": {
"name": "foobar-service",
"groupName": "pl.allegro.public.group",
"qualifiedName": "pl.allegro.public.group.DummyEvent"
}
}
},
{
"type": "SUBSCRIPTION",
"name": "barbaz-service",
"subscription": {
"topic": {
"name": "barbaz-service",
"groupName": "pl.allegro.public.group",
"qualifiedName": "pl.allegro.public.group.DummyEvent"
}
}
}
],
"totalCount": 3
}
5 changes: 5 additions & 0 deletions hermes-console/json-server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const activeOfflineRetransmissionTasks = require('./active-offline-retransmissio
const subscriptions = require('./subscriptions.json');
const routes = require('./routes.json');
const filterDebug = require('./filter-debug.json');
const search = require('./search.json');

const jsonServer = require('json-server');
const server = jsonServer.create();
Expand All @@ -21,6 +22,10 @@ server.post('/query/subscriptions', (req, res) => {
res.jsonp(subscriptions);
});

server.get('search/query', (req, res) => {
res.jsonp(search);
});

server.post('/topicSubscriptions', (req, res) => {
res.sendStatus(200);
});
Expand Down
4 changes: 2 additions & 2 deletions hermes-console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Console for Hermes Management",
"license": "Apache-2.0",
"engines": {
"node": ">=22.12.0"
"node": ">=22.20.0"
},
"scripts": {
"dev": "vite",
Expand All @@ -29,7 +29,7 @@
"vue-i18n": "11.1.10",
"vue-router": "4.3.2",
"vue3-ace-editor": "2.2.4",
"vuetify": "3.10.5"
"vuetify": "3.11.0"
},
"devDependencies": {
"@mdi/font": "7.4.47",
Expand Down
39 changes: 39 additions & 0 deletions hermes-console/src/api/SearchResults.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
export interface SearchResults {
totalCount: number;
results: SearchResultItem[];
}

export type SearchResultItem =
| SearchResultTopicItem
| SearchResultSubscriptionItem;

export interface SearchResultTopicItem {
type: 'TOPIC';
name: string;
topic: TopicItemDetails;
}

export interface TopicItemDetails {
groupName: string;
owner: TopicOwnerDetails;
}

export interface TopicOwnerDetails {
id: string;
}

export interface SearchResultSubscriptionItem {
type: 'SUBSCRIPTION';
name: string;
subscription: SubscriptionItemDetails;
}

export interface SubscriptionItemDetails {
topic: SubscriptionTopicDetails;
}

export interface SubscriptionTopicDetails {
name: string;
qualifiedName: string;
groupName: string;
}
7 changes: 7 additions & 0 deletions hermes-console/src/api/hermes-client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import type { Owner, OwnerSource } from '@/api/owner';
import type { ResponsePromise } from '@/utils/axios/axios-utils';
import type { RetransmissionDate } from '@/api/OffsetRetransmissionDate';
import type { Role } from '@/api/role';
import type { SearchResults } from '@/api/SearchResults';
import type { SentMessageTrace } from '@/api/subscription-undelivered';
import type { Stats } from '@/api/stats';
import type { SubscriptionHealth } from '@/api/subscription-health';
Expand Down Expand Up @@ -305,6 +306,12 @@ export function querySubscriptions(
});
}

export function search(query: string): ResponsePromise<SearchResults> {
return axios.get<SearchResults>(
`/search/query?q=${encodeURIComponent(query)}`,
);
}

export function fetchRoles(path: string): ResponsePromise<Role[]> {
return axios.get<Role[]>(path);
}
Expand Down
Loading
Loading