forked from allegro/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into gradle_cleanup
- Loading branch information
Showing
109 changed files
with
3,563 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Inactive Topics Detection | ||
|
||
Hermes Management provides an optional feature to detect inactive topics and | ||
notify about them. This feature is **disabled by default**. You can enable it | ||
and configure other options in the Hermes Management configuration. | ||
|
||
Option | Description | Default value | ||
-------------------------------------------------------------|----------------------------------------------------------------------------|--------------- | ||
detection.inactive-topics.enabled | enable inactive topics detection | false | ||
detection.inactive-topics.inactivity-threshold | duration after which a topic is considered inactive and first notified | 60d | ||
detection.inactive-topics.next-notification-threshold | duration after previous notification after which a topic is notified again | 14d | ||
detection.inactive-topics.whitelisted-qualified-topic-names | list of qualified topic names that will not be notified event if inactive | [] | ||
detection.inactive-topics.cron | cron expression for the detection job | 0 0 8 * * * | ||
detection.inactive-topics.notifications-history-limit | how many notification timestamps will be kept in history | 5 | ||
|
||
The detection job runs on a single instance of Hermes Management that is a | ||
leader based on the leader election Zookeeper instance. | ||
|
||
Option | Description | Default Value | ||
------------------------------------|-----------------------------------------------------------------------------|--------------- | ||
management.leadership.zookeeper-dc | Specifies the datacenter of the Zookeeper instance used for leader election | dc | ||
|
||
To make notifying work, you need to provide an implementation of | ||
`pl.allegro.tech.hermes.management.domain.detection.InactiveTopicsNotifier` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
{ | ||
"inactiveTopics": [ | ||
{"topic": "group.topic1", "lastPublishedTsMs": 1732499845200, "notificationTsMs": [1733499835210, 1733499645212], "whitelisted": false}, | ||
{"topic": "group.topic2", "lastPublishedTsMs": 1633928665148, "notificationTsMs": [], "whitelisted": true}, | ||
{"topic": "pl.allegro.public.group.DummyEvent", "lastPublishedTsMs": 1633928665148, "notificationTsMs": [1733499645212], "whitelisted": false} | ||
], | ||
"groups": [ | ||
"pl.allegro.public.offer", | ||
"pl.allegro.public.offer.product", | ||
|
@@ -138,6 +143,11 @@ | |
"offlineClientsSource": { | ||
"source": "https://www.openstreetmap.org/export/embed.html?bbox=-0.004017949104309083%2C51.47612752641776%2C0.00030577182769775396%2C51.478569861898606&layer=mapnik" | ||
}, | ||
"topicClients": [ | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]" | ||
], | ||
"inconsistentTopics": [ | ||
"pl.allegro.group.Topic1_avro", | ||
"pl.allegro.group.Topic2_avro", | ||
|
@@ -203,7 +213,7 @@ | |
}, | ||
"jsonToAvroDryRun": false, | ||
"ack": "LEADER", | ||
"trackingEnabled": false, | ||
"trackingEnabled": true, | ||
"migratedFromJsonType": false, | ||
"schemaIdAwareSerializationEnabled": false, | ||
"contentType": "AVRO", | ||
|
@@ -241,6 +251,14 @@ | |
"throughput": "0.0" | ||
} | ||
], | ||
"topicsTrackingUrls": [ | ||
{"name": "Tracking Link 1", "url": "#"}, | ||
{"name": "Tracking Link 2", "url": "#"} | ||
], | ||
"subscriptionsTrackingUrls": [ | ||
{"name": "Tracking Link 1", "url": "#"}, | ||
{"name": "Tracking Link 2", "url": "#"} | ||
], | ||
"topicsOwners": [ | ||
{ | ||
"id": "41", | ||
|
@@ -383,7 +401,7 @@ | |
"retryClientErrors": true, | ||
"backoffMaxIntervalMillis": 600000 | ||
}, | ||
"trackingEnabled": false, | ||
"trackingEnabled": true, | ||
"trackingMode": "trackingOff", | ||
"owner": { | ||
"source": "Service Catalog", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export interface InactiveTopic { | ||
topic: string; | ||
lastPublishedTsMs: number; | ||
notificationTsMs: number[]; | ||
whitelisted: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface TrackingUrl { | ||
name: string; | ||
url: string; | ||
} |
43 changes: 43 additions & 0 deletions
43
hermes-console/src/components/tracking-card/TrackingCard.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { expect } from 'vitest'; | ||
import { render } from '@/utils/test-utils'; | ||
import TrackingCard from '@/components/tracking-card/TrackingCard.vue'; | ||
|
||
describe('TrackingCard', () => { | ||
const props = { | ||
trackingUrls: [ | ||
{ name: 'url1', url: 'https://test-tracking-url1' }, | ||
{ name: 'url2', url: 'https://test-tracking-url2' }, | ||
], | ||
}; | ||
|
||
it('should render title properly', () => { | ||
// when | ||
const { getByText } = render(TrackingCard, { props }); | ||
|
||
// then | ||
const row = getByText('trackingCard.title'); | ||
expect(row).toBeVisible(); | ||
}); | ||
|
||
it('should render all tracking urls', () => { | ||
// when | ||
const { container } = render(TrackingCard, { props }); | ||
|
||
// then | ||
const elements = container.querySelectorAll('a')!!; | ||
expect(elements[0]).toHaveAttribute('href', 'https://test-tracking-url1'); | ||
expect(elements[0]).toHaveTextContent('url1'); | ||
expect(elements[1]).toHaveAttribute('href', 'https://test-tracking-url2'); | ||
expect(elements[1]).toHaveTextContent('url2'); | ||
}); | ||
|
||
it('should render message when no tracking urls', () => { | ||
// given | ||
const emptyProps = { trackingUrls: [] }; | ||
const { getByText } = render(TrackingCard, { emptyProps }); | ||
|
||
// then | ||
const row = getByText('trackingCard.noTrackingUrls'); | ||
expect(row).toBeVisible(); | ||
}); | ||
}); |
Oops, something went wrong.