12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import { AcknowledgementService } from "../services/acknowledgement.service";
- import { StreamingService } from "./test-streamOBS";
- import { MessageSyncrhonizationService } from "../services/synchronization.service";
- import { IncomingMessageService } from "../services/incomingMessage.service";
- import { map, Observable, take } from "rxjs";
- import { LogSetting, MessageLog } from "../dependencies/fisloggingservice/type/datatype";
- import { BaseMessage } from "../dependencies/fisappmessagejsutilty/dependencies/dependencies";
- const incoming = new IncomingMessageService()
- const syncrhonize = new MessageSyncrhonizationService()
- const streamService = new StreamingService()
- /* -------------- TEST -------------------- */
- // change payload into Observable<BaseMessage>
- const payload: Observable<BaseMessage> = streamService.stream().pipe(
- map(dataSet => ({
- header: dataSet.appLogLocId,
- data: dataSet
- })),
- take(5)
- );
- // TESTING. Please ignore this
- // payload.pipe(take(3)).subscribe({
- // next: data => console.log(data),
- // error: err => console.error(err),
- // complete: () => console.log(`Streaming Completed`)
- // })
- // Configure Log Setting
- let storage: LogSetting = {
- storage: "MongoDB",
- 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",
- collection: "log",
- }
- }
- let dataSet: LogSetting & { incomingObservable: Observable<BaseMessage> } = {
- storage: storage.storage,
- setting: storage.setting,
- customSetting: storage.customSetting,
- incomingObservable: payload
- }
- incoming.init(dataSet)
|