nest-mqtt icon indicating copy to clipboard operation
nest-mqtt copied to clipboard

multiple mqtt clients using forRootAsync

Open huaxiaoxuan7 opened this issue 4 years ago • 0 comments

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.

huaxiaoxuan7 avatar Aug 03 '20 13:08 huaxiaoxuan7