App

The App section brings together the main settings of the application, including the license key, Debug modes with detailed logs, settings for multi-tenant environments in SaaS and Idempotency.

One of the main settings of App is the option to view advanced logs for debugging/troubleshooting in the microservice. You can partially enable by adapter or “Debug=true” mode to affect the entire project.

Use this configuration mode to investigate possible problems in the application. If you are using containerized you will additionally have a list of all the variables received.

In this item we can also configure the Multi-Tenancy feature for SaaS (Software as a Service) applications and the Idempotency feature.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  "DevPrime_App": {
    "License":"**** Put your license code ****",
    "Debug": "false",
    "DebugWeb": "false",
    "DebugState": "false",
    "DebugStream": "false",
    "DebugServices": "false",
    "Tenancy": {
      "Enable": "false",
      "Type": "Shared",
      "Gateway": "https://localhost:5003",
      "Cache": "State2"
    },
    "Idempotency": {
      "Enable": "false",
      "Alias": "State2",
      "Duration": "86400",
      "Flow": "frontend",
      "key": "transactionid",
      "Scope": "all",
      "Action": "auto"
    }
  },

In the example below, we’re detailing the default App settings grouped into General, Tenancy, and Idempotency.

App
License Devprime License Information
Debug Enables Verbose Debugging on all services (True/False)
DebugWeb Enable Debug only for the Web Adapter (True/False)
DebugState Enable Debug only for Adapter State (True/False)
DebugStream Enable Debug for Adapter Stream only (True/False)
DebugServices Enable Debug for Adapter Services only (True/False)
Tenancy
Enable Enable Multi-tenant / SaaS Support (True/False)
Type Sets up the Tenacy strategy
Gateway Tenacy Gateway Url
Cache Configures a State service for persistence
Idempotency
Enable Activate the Idempotency service (True/False)
Alias Configures a State service for persistence
Duration Sets the duration of Idempotency and protection against duplicate records
Flow Define the type of Flow (Backend or Frontend)
key Set a required key in the head of the request with the Flow “Frontend”
Scope Configures the performance of Idempotencia (All or Web or Stream)
Action Defines whether the Idepotency will be automatic or manual (Auto or Manual)

Additional Considerations:

  • When using the “Frontend” flow, it will be mandatory to enter a key in the header during the request in the API.
  • By configuring the scope, you limit the performance of Idempotency to a specific context.
  • When configuring the action as manual, it will be necessary to define directly in the code which item will have the Idempotency, either in the API or in the Stream.

YAML example with application settings:
To export the configurations as an environment variable and use in Kubernetes, run the command in the Devprime CLI:
dp export kubernetes

1
2
3
4
5
6
- name: devprime_app
  value: "license=Put your license code|||debug=false|||debugstate=false|||debugstream=false
  |||debugweb=false|||tenancy=[enable=false,type=Shared,cache=State2
  ,gateway=https://localhost:5003]
  |||idempotency=[Enable=false,Alias=State2,Duration=86400,
  Flow=backend,key=idempotency-key,Scope=all,Action=auto]"
Last modified August 20, 2024 (2f9802da)