Last updated Apr 17, 2025
Internal use only

How to locally run CNS?

Repository link - commerce-notification-hub

Assumptions / Pre-requisites:

Follow this Developer Setup for initial setup of below mentioned tools:

Steps for running data ingestion

Run the following commands to get your local up and running:

  1. In the root directory (commerce-notificaiton-hub)

    1
    2
    mvn install
    
  2. In data-ingestion directory (docker app should be open)

    1
    2
    mvn install
    
  3. Initialize to spin up local SQS, DynamoDB, etc. - Remember to keep docker app open before running this command.

    1
    2
    docker compose up
    
  4. Run this command in commere-notification-hub root directory to generate an environment config file

    1
    2
    atlas micros service assume --service=data-ingestion --env=stg-east > data-ingestion/local.env
    
  5. Select the generated file as the envFile while running the application

    1. Click on the Edit option in the menu section present on the top-right corner of IntelliJ.

      local-env-config-step-1

    2. Click on Modify options in the Build and run section and select Environment variables

      local-env-config-step-2

    3. Select the path of your local.env file

      local-env-config-step-3

    4. Click on Apply and then Ok

      local-env-config-step-4

  6. Add the following values to the local.env file before starting application

    1
    2
        DATA_INGESTION_STATSIG_KEY='xxxx'
        MICROS_ENV='local'
        MICROS_PLATFORM_STATSD_HOST='localhost'
        MICROS_PLATFORM_STATSD_PORT='1111'
    
  7. To start the application click on Play in the top-right corner. Note: Before clicking on play, make sure that Data-Ingestion has been selected in the drop-down.

Steps for running notification-orchestration:

Repeat same steps as above

In Step 4, run this command instead:

1
2
atlas micros service assume --service=notification-orchestration --env=stg-east > com-notification-orchestration/local.env

Rate this page: