Skip to content
Snippets Groups Projects
Commit f0f9efb3 authored by Benguria Elguezabal, Gorka's avatar Benguria Elguezabal, Gorka
Browse files

fix configservice for rxStomp

parent 0c3eb88a
No related branches found
No related tags found
No related merge requests found
...@@ -49,11 +49,20 @@ import { ExistingSimulationsComponent } from "./existing-simulations/existing-si ...@@ -49,11 +49,20 @@ import { ExistingSimulationsComponent } from "./existing-simulations/existing-si
import { MlModuleComponent } from "./ml-module/ml-module.component"; import { MlModuleComponent } from "./ml-module/ml-module.component";
import { RecommenderPageComponent } from "./recommender-page/recommender-page.component"; import { RecommenderPageComponent } from "./recommender-page/recommender-page.component";
import { EditNetworkMapComponent } from "./edit-network-map/edit-network-map.component"; import { EditNetworkMapComponent } from "./edit-network-map/edit-network-map.component";
import { ConfigService } from '@ngx-config/core';
const rxStompConfig: InjectableRxStompConfig = { export class MyRxStompConfig extends InjectableRxStompConfig {
brokerURL: environment.baseStompURL, constructor(private configService: ConfigService) {
debug: (msg) => environment.showWebSocketDebug && console.debug(msg), super();
this.brokerURL = `${configService.getSettings("traffic_simulation_stomp_url")}`;
this.heartbeatIncoming = 0;
this.heartbeatOutgoing = 10000;
this.reconnectDelay = 500;
this.debug = (msg: string): void => {
environment.showWebSocketDebug && console.debug(msg);
}; };
}
}
@NgModule({ @NgModule({
imports: [ imports: [
...@@ -103,7 +112,8 @@ const rxStompConfig: InjectableRxStompConfig = { ...@@ -103,7 +112,8 @@ const rxStompConfig: InjectableRxStompConfig = {
providers: [ providers: [
{ {
provide: InjectableRxStompConfig, provide: InjectableRxStompConfig,
useValue: rxStompConfig, useClass: MyRxStompConfig,
deps: [ConfigService]
}, },
{ {
provide: RxStompService, provide: RxStompService,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment