Services

The services adapter facilitates integration with external services HTTP, gRPC, GraphQL as well as integration with secure API’s and support for Retry and CircuitBreak features.

The “connections” parameter defines the settings for the credentials required to access an API protected by, for example, KeyCloak or Auth0.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
"Devprime_Services": {
   "Timeout": "10",
   "CircuitBreak": "45",
   "Retry": "3",
   "connections": [
   {
      "Timeout": "10",
      "Name": "Service1",
      "TokenUri": "Put your provider url",
      "ClientId": "Put ClientId",
      "ClientSecret": "Put client secret",
      "GrantType": "client_credentials",
      "Audience": "Audience"
   }
   ]
},

The table below details the configuration parameters and custom connections of the Services Adapter, which can, for example, access an external API that requires authentication to an identity provider for secure access.

Services
Timeout Configures the time to fail by timeout
CircuitBreak Configures the duration of CircuitBreak
Retry Configures the number of retries in the case of timeout
Connections
Name Sets a unique identifier for this connection
Timeout Set a custom timeout
TokenUri Configures the Identity Provider URL
ClientId Configure the ClientId
ClientSecret Set up the password
GrantType Sets the type of “Grant”, e.g. “client_credentials”
Audience Define the audience, for example, “Audience”

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
- name: DevPrime_Services
   value: "retry=3|||circuitbreak=45|||timeout=10|||connections=
   [audience=Audience,clientid=Put ClientId,
   clientsecret=Put client secret, granttype=client_credentials,
   name=Service1,timeout=10,tokenuri=Put your provider url]"

Explore implementation examples:

Last modified August 20, 2024 (2f9802da)