refactor(pipeline, repo): rabbitmq
This commit is contained in:
21
src/commons/utils/rabbit-mq.ts
Normal file
21
src/commons/utils/rabbit-mq.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { hostname } from 'os';
|
||||
|
||||
export function getInstanceName() {
|
||||
return hostname();
|
||||
}
|
||||
|
||||
export function getSelfInstanceRouteKey(key: string) {
|
||||
return getAppInstanceRouteKey(key, getInstanceName());
|
||||
}
|
||||
|
||||
export function getAppInstanceRouteKey(key: string, appInstance?: string) {
|
||||
return appInstance ? `${key}.${appInstance}` : key;
|
||||
}
|
||||
|
||||
export function getSelfInstanceQueueKey(key: string) {
|
||||
return getAppInstanceQueueKey(key, getInstanceName());
|
||||
}
|
||||
|
||||
export function getAppInstanceQueueKey(key: string, appInstance?: string) {
|
||||
return appInstance ? `${key}.${appInstance}` : key;
|
||||
}
|
Reference in New Issue
Block a user