We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
constructor(private _mqttService: MqttService ) {} ngOnInit(): void { this._mqttService.connect(); this.getMessage(); } getMessage() { this.mqttSubscription = this._mqttService .observe(key) .subscribe((message: IMqttMessage) => { console.log(message.payload.toString()); }); }
app.module
export const MQTT_SERVICE_OPTIONS: IMqttServiceOptions = { hostname: 'mqtest.nbamyl.com', port: 443, protocol: location.protocol === 'https:' ? 'wss' : 'ws', username: 'auxyl', password: 'Auxyl2020', path: '/ws', keepalive: 10, connectOnCreate: false }; @NgModule({ declarations: [AppComponent], imports: [ BrowserModule, BrowserAnimationsModule, SharedModule, ServicesModule, MqttModule.forRoot(MQTT_SERVICE_OPTIONS), // routing module should stay at bottom AppRoutingModule ], providers: [], bootstrap: [AppComponent] })
It works well at first, but there is no message after a while. then I reload the page, it is back to normal again.
The text was updated successfully, but these errors were encountered:
Would you be so kind and provide a MWE as the issue template asked you to do so?
Sorry, something went wrong.
No branches or pull requests
app.module
It works well at first, but there is no message after a while. then I reload the page, it is back to normal again.
The text was updated successfully, but these errors were encountered: