Striim 4.0.4 documentation

HTTP Writer

Sends a custom response to an HTTP Reader source when the source's Defer Response property is set to True. If HTTPWriter does not return a response before the Defer Response Timeout specified in HTTPReader, HTTPReader will respond with error 408 with the body, "Request timed out. Make sure that there is an HTTPWriter in the current application with property Mode set to RESPOND and HTTPWriter property RequestContextKey is mapped correctly, or set HTTPReader property DeferResponse to FALSE, or check Striim server log for details."



default value





Do not change default value.

Request Context Field



The name of the input stream field that contains the UUID of the HTTP Reader source that will send the response. This UUID is the value of the RequestContextField metadata field of the HTTPReader's output stream (see HttpCacheResponseApp.tql for an example).

Response Code Field



Status code for the custom response. Typically the default value of "200" will be appropriate unless your application has multiple instances of HTTP Writer that will handle events with various characteristics (see HttpCacheResponseApp.tql for an example).

Response Headers


Optionally, specify one or more header fields to be added to the custom response using the format <header name>=<value>. Separate multiple headers with semicolons. The value can be a static string (for example, Server="Striim") or the value of a specified input stream field (for example, Table=@metadata(TableName); Operation=@metadata{OperationName)).


The following instructions require that Striim be running locally, as described in Installing Striim for evaluation purposes or Running Striim as a process.

To see how this works, run striim/docs/HTTPWriter/HttpCacheResponseApp.tql, open a terminal or command prompt, and enter the following (if Striim is not running on your local system, change to the IP address of the Striim server):

curl --location --request POST '' \
--header 'Content-Type: text/csv' \
--data-raw 'COMPANY 1'

That will return the cache entry for Company 1:


Then enter the following:

curl --location --request POST '' \
--header 'Content-Type: text/csv' \
--data-raw 'COMPANY 99'

Since there is no entry for Company 99 in the cache, that will return:

  "MESSAGE":"Requested entry was not found in cache."

See the comments in HttpCacheResponseApp.tql for more information.