1.1.15 • Published 1 year ago

cds.email-subscription v1.1.15

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

cds.message-consumer-template

A template repository for CDS message consumers

To create a new CDS Message Consumer based on template, do the following steps:

  1. Create a new repository using a template repository cds.message-consumer-template.
  2. Configure function.json file:

    {
    "bindings": [
        {
        "name": "message",
        "type": "serviceBusTrigger",
        "direction": "in",
        "topicName": "sample-topic-name",
        "subscriptionName": "sample-subscription-name",
        "connection": "Connector_ServiceBus__fullyQualifiedNamespace"
        }
    ],
    "scriptFile": "../dist/MessageConsumer/index.js",
    "disabled": false
    }
  3. Change MessageConsumer folder name for a unique name like "sampleMessageConsumer", and change directory in "scriptFile" field in the function.json file.

  4. To run the consumer on the local environment, add local.settings.json file in the main application directory:

    {
        "IsEncrypted": false,
        "Values": {
            "FUNCTIONS_WORKER_RUNTIME": "node",
            "AzureWebJobsStorage": "", //Unused key, but it's required by Azure Function
            "OutputBlobStorage__serviceUri": "", //Connection string to the Azure Blob Storage
            "ServiceBus__fullyQualifiedNamespace": "" //Connection string to the Azure Service Bus
        }
    }
  5. Run npm install

  6. Run npm start
  7. To install @cantire-corp packages locally, add .npmrc file in the main application directory:

    //npm.pkg.github.com/:_authToken=${YOUR_AUTH_TORKEN_NAME} 
    registry=https://npm.pkg.github.com/cantire-corp
  8. To run the logger locally, add .env file in the main application directory:

    LOG_LEVEL="info"
    LOGS_FOLDER="logs"