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 of the credentials required to access an API protected, for example, by 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 for the Services Adapter, which can, for example, access an external API that requires authentication to an identity provider for access security.

Services
Timeout Configures the time to fail by timeout
CircuitBreak Configures the duration of CircuitBreak
Retry Configure the number of attempts in case of timeout
Connections
Name Defines 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”, for example, “client_credentials”
Audience Define the audience, e.g. “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 October 17, 2023 (e38ae05b)