Environment variables for LemonEdge Task Service & Web Service

The Task service and Web service expect the following list of environment variables. To convert the following snippets into cloud-specific environment variables, please see the article App Settings Conversion.

Database Connection Variables

{
"LemonEdge": {
"ConnectionSettings": {
"ConnectionString": "<db-connection-string>"
}
}
}

 

Storage Variables

{
"LemonEdge": {
"StorageSettings": {
"StorageType": "<storage-type>", // AWS, Azure, Local
"StorageConnectionString": "<azure-connection-string>", // Azure only
"RegionName": "<s3-bucket-region-name>", // AWS only
"StorageBasePath": "<storage-base-path>",
"ServiceUrl": "<aws-local-dev-service-url>" // AWS Only
}
}
}

Note: The storage base path may be defined as the blob container name for Azure, the S3 bucket name for AWS, or the root path (i.e. "C:/MyLocalStorage/") for Local storage.

 

Message Variables

AWS

{
"LemonEdge": {
"MessageSettings": {
"MessageType": "AWS",
"MessageTopicForServerSync": "<sns-topic-name>",
"AuthenticationMethod": "<authentication-method>",
"AccessKey": "",
"SecretAccessKey": "",
"SessionToken": "",
"ServiceUrl": "",
"AuthenticationRegion": "",
"RegionName": "eu-west-2",
"QueueName": "sns-my-test-topic-{newId}-{machineName}",
"QueueGroup": "dev-qa-prod",
"QueueWaitTimeSeconds": 10,
"QueueMaxNumberOfMessages": 2,
"QueueAttributes": {
"FifoQueue": "true"
},
"QueueTags": {
"MachineName": "{machineName}",
"Source": "TestApplication",
"MyTag": "MyValue"
},
"AutoCleanupOrphanedQueues": true,
"AutoCleanupOrphanedQueuesResponseTime": 120
}
}
}

 

AWS Variables Definitions

MessageType
: Defines the type of messaging to use within the system, for AWS,
this should be set to AWS or `MessageServiceType.Aws`

MessageTopicForServerSync
: The topic to which we will publish all messages and subscribe all callbacks

AwsAuthenticationMethod
: The type of `AwsAuthenticationMethod` to use
: Role: Uses the configured IAM user and is the recommended method for production services
: Basic: Uses an AccessKey and SecretAccessKey
: Session: Uses a temporary AccessKey, SecretAccessKey, and SessionToken
: ServiceUrl: Uses a service URL and authentication region

AccessKey
: The Amazon access key to be used for `Basic` or `Session` authentication methods
: Required for the `Basic` or `Session` authentication methods

SecretAccessKey
: The Amazon secret access key to be used for `Basic` or `Session` authentication methods
: Required for the `Basic` or `Session` authentication methods

SessionToken
: The Amazon session token to be used for the `Session` authentication method
: Required for the `Basic` or `Session` authentication methods

ServiceUrl
: The Service URL to be used for AWS client connections
: Required for the `ServiceUrl` authentication method
: Used with LocalStack

AuthenticationRegion
: The authentication region to be used for AWS client connections
: Required for the `ServiceUrl` authentication method
: Used with LocalStack

RegionName
: The amazon region name (i.e. eu-west-2)

QueueName [OPTIONAL]
: The name to use when creating the dynamic queue that is then subscribed back to the SNS instance.
The queue name can include various variables to assist with dynamicity.
: {machineName} - Replaced with the server name or docker container ID
: {newId} - Replaced with a alpha-numeric GUID
: MAX: 80 characters
: DEFAULT: The machine name or docker container ID
: NOTE: If the FIFO queue attribute is set, this name must end with ".fifo"

QueueGroup [OPTIONAL]
: The group to which dynamically created queues belong.
: DEFAULT: "LemonEdge"
: NOTE: When auto clean up of orphaned queues is enabled, only queues from the
assigned group will be considered for deletion.

QueueWaitTimeSeconds [OPTIONAL]
: The amount of time to wait in seconds to receive a message. If set to 0, short-polling will occur, otherwise
long-polling is used.
: MAX: 20
: DEFAULT: 1

QueueMaxNumberOfMessages [OPTIONAL]
: The number of messages to be processed at a time
: MAX: 10 messages
: DEFAULT: 1

QueuePollWaitTimeOnError [OPTIONAL]
: A array of wait times in seconds that reflect a backoff period (i.e. `[1, 2, 5, 10]`)
: Due to the nature of SQS, the system must poll the queue on a period set by `QueueWaitTimeSeconds`.
As this polling occurs via looping, if an error occurs we may want to wait increasingly long times before
trying again as to not flood logs with errors.
: DEFAULT: [ 5 ]

QueueAttributes [OPTIONAL]
: A list of key-value pairs that will be passed along as attributes to the dynamically created SQS queue.
: For instance, if we want the queue to be FIFO we could provide: `[{ "IsFifo", "true" }]`
: NOTE: If the FIFO queue attribute is set, the queue name must end with ".fifo"

QueueTags [OPTIONAL]
: A list of key-value pairs that will be passed along as tags to the dynamically created SQS queue. Supports variables.
: For instance, if we want the docker container ID we could provide : `[{ "ContainerID": "{machineName}" }]`

AutoCleanupOrphanedQueues [OPTIONAL]
: If enabled, the system will automatically attempt to clean up any orphaned queues at startup.
: DEFAULT: `false`

AutoCleanupOrphanedQueuesResponseTime [OPTIONAL]
: The amount of time (in seconds) to wait for services to respond with a SQS heartbeat response when cleaning up orphaned queues.
: DEFAULT: `120`

 

Azure

{
"MessageSettings": {
"MessageType": "Azure",
"MessageTopicForServerSync": "my-test-topic",
"MessageConnectionString": "",
"SubscriberName": "sb-{newId}-{machineName}",
"AutoDeleteSubscriptionOnIdleHours": 1
}
}

 

Azure Variables Definitions

Type
: Defines the type of messaging to use within the system, for Azure,
this should be set to Azure or `MessageServiceType.Azure`

MessageTopicForServerSync
: The topic to which we will publish all messages and subscribe all callbacks

MessageConnectionString
: The Azure Service Bus connection string.
: See documentation here

SubscriberName [OPTIONAL]
: The name to use when creating the dynamic subscription to the service bus topic.
The queue name can include various variables to assist with dynamicity.
: {machineName} - Replaced with the server name or docker container ID
: {newId} - Replaced with a alpha-numeric GUID
: MAX: 30 characters
: DEFAULT: The machine name or docker container ID

AutoDeleteSubscriptionOnIdleHours [OPTIONAL]
: The amount of idle time in hours after which the created subscription should be deleted
: DEFAULT: 3

 

For versions <= 3.1.2311.2001

{
"LemonEdge": {
"MessageSettings": {
"MessageType": "<storage-type>", // AWS, Azure
"MessageConnectionString": "<azure-connection-string>", // Azure only
"RegionName": "<sqs-region-name>", // AWS only
"MessageTopicForServerSync": "<topic-name>"
}
}
}

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.