Breadcrumbs

EnhancedHttpPostRecipient


Description

The EnhancedHttpPostRecipient is used to push an alarm to an external API just like the HttpPostRecipient but It brings some new features :

  • Add your own body to the request

  • Get the response of the request

  • Deal with the errors by forwarding the alarm in a new topic

image-20250304-134935.png


Implementation

It works exactly the same as HttpPostRecipient except you can add the body to your request.

You can also handle the error in the request:

  • Link the "alarm" slot of alarm classes to the "routeAlarm" slot of the EnhancedHttpPostRecipient

  • Link the “forwardFailedAlarm” slot to anyhting else handling topi. In the example it is linked to another EnhancedHttpPostRecipient sending a request to a different URL. Donig something like this allows you to be almost sure that at least one request will not fail. Because if an alrm is triggered it is quite important to be aware of it.

image-20250304-135143.png

Properties

  • Status: Indicates the general status of the component, {ok} if the operation was successful or {fault} to indicate abnormal behavior

  • FaultCause: Indicates the cause of a configuration error. The FaultCause is empty if the component is properly configured.

  • Url: The address of the API server to make the POST request

  • PingUrl: The address to ping to test the API server

  • Headers: Optional HTTP headers

  • Enabled: Boolean turning on and off the recipient

  • RouteAlarmcount: the number of succeeding request

  • ForwardFailedAlarmCount: the number of failed request wich have been forwarded

  • Body: the body of the request you want to send

  • Response: the body of the request response


Actions

  • Ping: Ping the "pingUrl" address to try to test the API server


Topic

  • ForwardFailedAlarm: the alarm is forwarded is this topic when the return status of the request is an error (greater than 399).