HttpCommunications
The httpCommunications section allows you to create Http client communications.
These Http clients are used for make Http calls, for example, an Api Rest Endpoint. They are named and can be used in one or more service, if needed.
Note
This section should only be defined for communication needs with external services, which are not part of the service mesh generated by Beatrix.
All services specified in the YAML model are already automatically configured to communicate. An HttpCommunication called 'ServiceMeshCommunication' is configured in the Startup class of each generated service and ready to use in your custom business rules.
Fields
An httpCommunication contains the following fields to be defined:
Name
The name of httpCommunication to be created.
Requirements Rules:
- Is Required;
- Must not be a Reserved Keyword;
- Must start with a letter;
- Must contains only letters, numbers and the underline char ('_');
- Max length of 50 chars
Example:
1 2 |
|
BaseAddress
The base address URI of the resource used when sending requests.
Requirements Rules:
- Is Required;
- Must be a valid URI pattern
Example:
1 2 3 |
|
Headers
A key and value array in which you can define the requests headers.
Example:
1 2 3 4 5 |
|
Handlers
If you need to add message handlers to the current httpCommunication, just enter the httpHandlers names in this field.
Requirements Rules:
- Must haven't duplicated httpHandlers names;
- Each httpHandler name on array must exist in HttpHandlers list in the current model;
- See HttpHandlers section for more details.
- It is not allowed to use the HttpCommunication itself as BackChannel for httpHandler on array;
- It is not allowed to use the same httpHandler type more than once for the current HttpCommunication
Example:
1 2 3 4 5 6 7 |
|