Skip to content

Commit

Permalink
pubsub suffix changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PreethiMaai committed Oct 15, 2024
1 parent 9e70488 commit 7ced300
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ export default class App extends Base {
console.log('Response of Initialization :: ', res);
if (res != undefined) {
const action = res[0].discovery.navigateTo.action;
console.log('2458 action >>>>..',action)
if (action == 'search') {
let query = res[0].discovery.navigateTo.data.query;
let lifecycle_validationString;
Expand All @@ -394,7 +395,14 @@ export default class App extends Base {
if (lifecycle_validationString == true) {
process.env.LIFECYCLE_VALIDATION = 'true';
}
console.log('2458 query.params >>>>..',query.params)
if (query.params.pubSubPublishSuffix) {
process.env.PUBSUB_PUBLISH_TOPIC_SUFFIX = query.params.pubSubPublishSuffix;
}

if (query.params.pubSubSubscribeSuffix) {
process.env.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX = query.params.pubSubSubscribeSuffix;
}
process.env.APP_TYPE = query.params.appType ? query.params.appType.toLowerCase() : CONSTANTS.FIREBOLT_CONST;

try {
Expand Down
6 changes: 4 additions & 2 deletions src/pubSubClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class PubSubClient {
constructor() {
this.ws = null;
this.url = process.env.PUB_SUB_URL ? process.env.PUB_SUB_URL : 'ws://localhost:8080';
this.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX = '_FCS';
this.PUBSUB_PUBLISH_TOPIC_SUFFIX = '_FCA';
this.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX = process.env.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX ? process.env.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX : '_FCS';
this.PUBSUB_PUBLISH_TOPIC_SUFFIX = process.env.PUBSUB_PUBLISH_TOPIC_SUFFIX ? process.env.PUBSUB_PUBLISH_TOPIC_SUFFIX : '_FCA';
}

// Initializes a WS connection
Expand All @@ -49,6 +49,8 @@ class PubSubClient {
console.warn(`WARNING: No pubsub_uuid query parameter or MAC address found. Using default value: ${pubSubTopic}`);
}

console.log('2458 subscribe >>>>..',this.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX)
console.log('2458 publish >>>>..',this.PUBSUB_PUBLISH_TOPIC_SUFFIX)
process.env.PUBSUB_SUBSCRIBE_TOPIC = pubSubTopic + '_' + appId + this.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX;
process.env.PUBSUB_PUBLISH_TOPIC = pubSubTopic + '_' + appId + this.PUBSUB_PUBLISH_TOPIC_SUFFIX;

Expand Down

0 comments on commit 7ced300

Please sign in to comment.