You are viewing the documentation for Blueriq 14. Documentation for other versions is available in our documentation directory.

Session headers

This section is applicable to you when your have system HTTP headers that are sent with a request to the Blueriq Runtime and that need to be forwarded to other systems.

Introduction

In a production environment, HTTP headers may be sent by an application calling Blueriq Runtime. It is often very useful to be able to use these headers throughout a Blueriq session or when Blueriq Runtime calls other applications. These headers may contain context information, such as a ticket id. Blueriq Runtime can now be configured to store and send HTTP headers. The configuration consists of two steps: configure headers that you wish to store in the session, and configure the headers that you wish to send through a request to an external service.

See also Custom HTTP Headers for an overall picture.

Configure http-headers to store

HTTP headers that need to be stored in the Blueriq session can be configured by name in a comma separated list in the application.properties. In this example the headers with the names header1, header2, header3 and header4 and their values will be kept and stored in the Blueriq session. 

SubjectPropertyExplanationProperty location
user headersblueriq.user.headersComma separated list of incoming http-headersapplication.properties

Use header values in the profile

You can use Service call type: AQ_GetHeaders to assign header values to attributes in the profile.


Configure headers to send to service calls of type AQ_RestServiceClient or AQ_SoapServiceClient

Assuming that the headers that you wish to send with a Soap or Rest request are stored in the session, it is possible to indicate headers that are passed to all service calls:

application.properties
blueriq.connection.headers=header1,header3,header4

If the configured headers are available in the session, they will be sent with the HTTP request. If the configured headers are not available, the particular header will not be sent with the request and a warning that looks like this will be printed to the log:

The configured header header1 has not been put on the request because it is not available

If none of the blueriq.connection.headers are found in the session, this will be logged as follows:

No headers found for connection

Configure headers to send to a specific service call of type AQ_RestServiceClient or AQ_SoapServiceClient

If multiple service calls are in use, it might be desirable to configure which headers to send per service call or connection. In this way, you can override the value of blueriq.connection.headers.

Assuming that the headers that you wish to send with a Soap or Rest request are stored in the session, it is possible to indicate headers that are passed to a specific service call or connection. The property prefix matches the property prefix of your service name.

application.properties for a RestServiceCall
blueriq.connection.Example.http.url = http://example.com/rest/service
blueriq.connection.Example.http.headerNames = header2,header3
application.properties for a SoapServiceCall
blueriq.connection.SoapExample.soap.url = http://example.com/soap/service
blueriq.connection.SoapExample.soap.headers = header1,header2,header4

If the configured headers are available in the session, they will be sent with the HTTP request. If the configured headers are not available, the particular header will not be sent with the request and a warning that looks like this will be printed to the log:

The configured header header1 has not been put on the request because it is not available

If none of the headers specific to a rest service call, soap service call or connection are found in the session, this will be logged as follows:

No headers found for connection Example

Potential security risks

There is no way to let the Runtime distinguish between ordinary metadata and sensitive information. Please keep that in mind when you configure your headers. Headers that are stored in a Blueriq session are potentially accessible to business engineers and to external systems that communicate with Blueriq Runtime


Static headers (Since Blueriq 14.11)

This section is applicable to you when you want to configure key-value pairs of headers for outgoing SOAP and REST requests.

Global configuration

Key-value pairs of headers can be configured globally. In this case, the headers will be put on all outgoing SOAP and REST requests. Please note that globally configured static headers will be ignored for any connection that specifies their own static headers (see below).

application.properties
blueriq.connection.header.X-Header-1=Value1
blueriq.connection.header.X-Header-2=Value2

Per-connection configuration

Key-value pairs of headers can also be configured on a per-connection basis for both SOAP and REST requests. Please note that any globally configured static headers will be ignored for connections that specify static headers.

application.properties for a RestServiceCall
blueriq.connection.Example.http.url=http://example.com/rest/service
blueriq.connection.Example.http.header.X-Header-1=Value1
application.properties for a SoapServiceCall
blueriq.connection.SoapExample.soap.url=http://example.com/soap/service
blueriq.connection.SoapExample.soap.header.X-Header-1=Value1