nest-mqtt
nest-mqtt copied to clipboard
multiple mqtt clients using forRootAsync
Hi there!
In my project I am using more than one mqtt clients, each client is created by one specific module. It works fine when I'm using forRoot method.
However, when I switched to forRootAsync method, only the first module worked, other clients did not init. I tried to load the modules dynamically, but I got the same result. Where could be wrong?
In my app.module.ts:
@Module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
expandVariables: true,
}),
Module1,
Module2,
Module3,
Module4
]
})
Only Module1 worked.