Skip to content

Conversation

@Lenbkr
Copy link
Contributor

@Lenbkr Lenbkr commented Jul 9, 2024

What did we change?

Why are we doing this?

How was it tested?

  • Locally
  • Development Environment
  • Not needed, changes very basic
  • Husky successfully run
  • Unit tests passing and Documentation done

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 9, 2024

@Lenbkr Lenbkr requested a review from rtkay123 July 9, 2024 10:39
@Lenbkr Lenbkr requested a review from Justus-at-Tazama July 11, 2024 15:03
@Justus-at-Tazama
Copy link
Contributor

I can't seem to get this to work. I've deployed the cms-service in the Docker stack with a subject of cms. I tested this for the typology processor change and it was posting to the cms subject just fine.

I had a look through the code and noticed that the post to the NATS server is not explicitly taking in the optional parameter for the configuration.producerStream parameter set up in the .env:

https://github.com/frmscoe/transaction-aggregation-decisioning-processor/blob/a54ae1c986c959f2b0cffaccdeb9eeda1fb61ce9/src/services/logic.service.ts#L69

I compared the implementation of this NATS interaction with the one in the typology processor and they're quite different. Compare:

typology processor

    if (!configuration.suppressAlerts && isInterdicting) {
      // Send Typology to CMS
      const spanCms = apm.startSpan(`[${transactionId}] Send Typology result to CMS`);
      server
        .handleResponse({ ...tadpReqBody, metaData }, [configuration.cmsProducer])
        .catch((error) => {
          loggerService.error('Error while sending Typology result to CMS', error as Error, logContext, msgId);
        })
        .finally(() => {
          spanExecReq?.end();
          spanCms?.end();
        });
    }

tadproc

      if (!configuration.suppressAlerts) {
        const result: CMSRequest = {
          message: `Successfully completed ${typologies.length} typologies`,
          report: alert,
          transaction,
          networkMap,
        };

        result.report.tadpResult.prcgTm = CalculateDuration(startTime);
        await server.handleResponse(result);
      }

The typology processor explicitly passes the configured cms subject, the tadproc does not.

@Justus-at-Tazama Justus-at-Tazama merged commit c20e595 into dev Jul 16, 2024
@Justus-at-Tazama Justus-at-Tazama deleted the alertflag branch July 16, 2024 14:59
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.

TADProc - Create a non-action environment variable for alerting out of the platform

4 participants