Skip to content
New issue

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

Task[hmi-server]: reimplement ssemq on hmi server #2150

Merged
merged 20 commits into from
Nov 3, 2023

Conversation

dvince2
Copy link
Collaborator

@dvince2 dvince2 commented Nov 3, 2023

Description

  • Leveraging the mq/sse implementation from the pantera platform.
  • New messaging queue for ciemms and sciml simulations.
  • Simulation messages are sent to all users to update shared project results as they come in. Non subscribers will have messages ignored.

Resolves #2004

@dvince2 dvince2 linked an issue Nov 3, 2023 that may be closed by this pull request
@dvince2 dvince2 marked this pull request as ready for review November 3, 2023 13:09
@mwdchang mwdchang merged commit 555affc into main Nov 3, 2023
8 checks passed
@mwdchang mwdchang deleted the 2004-task-reimplement-ssemq-on-hmi-server branch November 3, 2023 14:48
@@ -33,6 +33,7 @@
"@lumino/commands": "2.1.3",
"@lumino/coreutils": "2.1.2",
"@lumino/widgets": "2.1.0",
"@microsoft/fetch-event-source": "^2.0.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use yarn add --exact @microsoft/fetch-event-source to pin the version number.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but this should go under /api folder as it is a utils and not a service per se.

Comment on lines -238 to +246
const handleIntermediateResult = (message: string) => {
/* const handleIntermediateResult = (message: string) => {
const parsedMessage = JSON.parse(message);
console.log(parsedMessage);
};
}; */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could remove it.

import TeraSimulateChart from '@/workflow/tera-simulate-chart.vue';
import TeraProgressBar from '@/workflow/tera-progress-bar.vue';
import { getTimespan } from '@/workflow/util';
import { logger } from '@/utils/logger';
import { subscribe, unsubscribe } from '@/services/ClientEventService';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { subscribe, unsubscribe } from '@/services/ClientEventService';
import * as ClientEventService from '@/services/ClientEventService';

Better to then call ClientEventService.subscribe()

@@ -42,6 +42,11 @@ public class Config {
*/
ClientConfig clientConfig;

/**
* If queues should be declared durable. IF running Rabbit inside docker, this should be false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* If queues should be declared durable. IF running Rabbit inside docker, this should be false
* If queues should be declared durable.
* If running Rabbit inside docker, this should be false.

@@ -83,3 +84,9 @@ tgpt.ws.url=wss://app.staging.terarium.ai/beaker_ws/
########################################################################################################################
spicedb.launchmode=TLS
spicedb.target=spicedb.staging.terarium.ai:443

# RabbitMQ exchange
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# RabbitMQ exchange
########################################################################################################################
# RabbitMQ exchange
########################################################################################################################

Comment on lines +49 to +51
if (handlers) {
handlers.forEach((handler) => handler(data));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (handlers) {
handlers.forEach((handler) => handler(data));
}
if (handlers) {
handlers.forEach((handler) => handler(data));
} else {
logger.info(`Message ${data.type} has no handler available`);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TASK]: Reimplement SSE/mq on hmi-server
3 participants