Creating custom headers for HTTP targets
As of Data Bridge 3.6.0, you can optionally enter custom header information into the HTTP Configuration section of the Publishing Options tab when you are specifying how event streaming updates will be published to an HTTP URL instead of Apache Kafka. You can provide information for the following fields:
- HTTP Custom Header - You can enter a custom header that provides additional information (for example, enter
secret
for an API to call a web hook). When specified, the custom header will be added to every outgoing HTTP request for the view. - HTTP Custom Header Class - You can enter a class name (for example,
brg:CustomHTTPHeader
). - HTTP Custom Header Event - You can enter an event name (for example,
getXhookKey
). - HTTP Custom Header Value - You can enter a header value (for example,
ad67e009
). If you have already entered an HTTP custom header class, the class will take precedence over the header value you have entered.
The custom header class and event values must be created at design time.
Creating a custom header class and event
To create a custom header class and event:
- Create a new metaclass.
Create an event in the metaclass that provides the value for a custom header. The following is an example of a custom header class:
SCHEME<Class> </Attributes> <Events> <Event name="getXhookKey" static="true" visibility="public"> <Actions> <Action name="main" type="main"><![CDATA(guid)]></Action> </Actions> </Event> </Events> </PersistenceMapping> </Class>
Enter the class name and event name in the HTTP Configuration section of the Publishing Options tab for the view you are configuring that will add the custom header.