App

The App session brings together the main configurations of the application, including the license key, the Debug modes with detailed logs, configurations for multi-tenant SaaS environments, 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 it by adapter or “Debug=true” mode to affect the entire project.

Use this configuration mode to investigate potential problems in your application. If you are using it in a container, 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 Identity 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 Use License Information
Debug Enable verbose Debugging on all services (True/False)
DebugWeb Enable Debugging for Web Adapter only (True/False)
DebugState Enables 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 Set up the Tenacy
Gateway Tenacy Gateway Url
Cache Configures a State service for persistence
Idempotency
Enable Enable the PowerUp service (True/False)
Alias Configures a State service for persistence
Duration Sets the duration of the 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 Idempotency (All or Web or Stream)
Action Sets whether Idempower 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 API request.
  • By configuring the scope, you limit Idempotency’s performance 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 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 April 16, 2024 (2b35fcc8)