wso2 / streaming-integrator

A stream processing runtime that allows connecting any streaming data source to any destination and act on it
Apache License 2.0
113 stars 50 forks source link

Transport properties for HTTP/SSE Source #206

Closed dilini-muthumala closed 2 weeks ago

dilini-muthumala commented 3 years ago

Description: According to the SSE specification, a event can have the following meta attributes, in addition to the data

Quoting from https://www.w3.org/TR/eventsource/#event-stream-interpretation

If the field name is "event" Set the event type buffer to field value.

If the field name is "data" Append the field value to the data buffer, then append a single U+000A LINE FEED (LF) character to the data buffer.

If the field name is "id" Set the last event ID buffer to the field value.

If the field name is "retry" If the field value consists of only ASCII digits, then interpret the field value as an integer in base ten, and set the event stream's reconnection time to that integer. Otherwise, ignore the field.

Is there any way to access these fields in an event? It would be useful if these fileds are made available to the SSE source as transport properties.

For example, a user might want to filter out the events of a certain type. Are we only passing the messages of type "message" ? If so, it would be useful to keep it as the default type, but give the user the ability to override it.

Affected Product Version: wso2si-tooling-4.0.0-SNAPSHOT

sajithshn commented 3 years ago

De-prioritizing as this is not a critical enhancement.