123456789101112131415161718192021222324252627282930313233343536373839 |
- import { AcknowledgementService } from "../services/acknowledgement.service";
- import { StreamingService } from "./test-streamOBS";
- import { map, Observable, take } from "rxjs";
- import { LogSetting } from "../dependencies/log/type/datatype";
- import { BaseMessage } from "../dependencies/log/dependencies/msgutil/interface/export";
- const acknowledge = new AcknowledgementService()
- const streamService = new StreamingService()
- /* -------------- TEST -------------------- */
- // change payload into Observable<BaseMessage>
- const payload: Observable<BaseMessage> = streamService.stream().pipe(take(3));
- // Configure Log Setting
- let storage: LogSetting = {
- storage: "MongoDB",
- cacheMessageLimit: 0,
- setting: {
- appName: 'Default from client',
- appLocName: 'To be generated in client',
- logLocName: 'To be generated in client',
- },
- customSetting: {
- srv: true,
- user: "testDB",
- password: "h1nt1OyXw6QeUnzS",
- server: "cluster0.29sklte.mongodb.net",
- database: "log",
- }
- }
- let dataSet: LogSetting & { incomingObservable: Observable<BaseMessage> } = {
- storage: storage.storage,
- setting: storage.setting,
- customSetting: storage.customSetting,
- incomingObservable: payload
- }
- acknowledge.init(storage).then(() => {
- acknowledge.subscribe(dataSet.incomingObservable)
- })
|