Siddhi IO HTTP
The siddhi-io-http extension is an extension to Siddhi that receives and publishes events via HTTP and HTTPS transports, calls external services, and serves incoming requests and provide synchronous responses.
For information on Siddhi and it's features refer Siddhi Documentation.
Download
- Versions 2.x and above with group id
io.siddhi.extension.*
from here. - Versions 1.x and lower with group id
org.wso2.extension.siddhi.*
from here.
Latest API Docs
Latest API Docs is 2.3.6.
Features
- http (Sink)
HTTP sink publishes messages via HTTP or HTTPS protocols using methods such as POST, GET, PUT, and DELETE on formats
text
,XML
andJSON
. It can also publish to endpoints protected by basic authentication or OAuth 2.0. - http-call (Sink)
The http-call sink publishes messages to endpoints via HTTP or HTTPS protocols using methods such as POST, GET, PUT, and DELETE on formats
text
,XML
orJSON
and consume responses through its corresponding http-call-response source. It also supports calling endpoints protected with basic authentication or OAuth 2.0. http-request (Sink)
(Use http-call sink instead).
The http-request sink publishes messages to endpoints via HTTP or HTTPS protocols using methods such as POST, GET, PUT, and DELETE on formatstext
,XML
orJSON
and consume responses through its corresponding http-response source. It also supports calling endpoints protected with basic authentication or OAuth 2.0.http-response (Sink)
(Use http-service-response sink instead).
The http-response sink send responses of the requests consumed by its corresponding http-request source, by mapping the response messages to formats such astext
,XML
andJSON
.- http-service-response (Sink)
The http-service-response sink send responses of the requests consumed by its corresponding http-service source, by mapping the response messages to formats such as
text
,XML
andJSON
. - sse-server (Sink)
HTTP SSE sink sends events to all subscribers.
- websubhub (Sink)
WebSubHubEventPublisher publishes messages via HTTP/HTTP according to the provided URL when subscribe to the WebSub hub. The table.name, hub.id are mandatory when defining the websubhub source
- http (Source)
HTTP source receives POST requests via HTTP and HTTPS protocols in format such as
text
,XML
andJSON
. It also supports basic authentication to ensure events are received from authorized users/systems.
The request headers and properties can be accessed via transport properties in the formattrp:<header>
. - http-call-response (Source)
The http-call-response source receives the responses for the calls made by its corresponding http-call sink, and maps them from formats such as
text
,XML
andJSON
.
To handle messages with different http status codes having different formats, multiple http-call-response sources are allowed to associate with a single http-call sink.
It allows accessing the attributes of the event that initiated the call, and the response headers and properties via transport properties in the formattrp:<attribute name>
andtrp:<header/property>
respectively. http-request (Source)
(Use http-service source instead).
The http-request source receives POST requests via HTTP and HTTPS protocols in format such astext
,XML
andJSON
and sends responses via its corresponding http-response sink correlated through a uniquesource.id
.
For request and response correlation, it generates amessageId
upon each incoming request and expose it via transport properties in the formattrp:messageId
to correlate them with the responses at the http-response sink.
The request headers and properties can be accessed via transport properties in the formattrp:<header>
.
It also supports basic authentication to ensure events are received from authorized users/systems.http-response (Source)
(Use http-call-response source instead).
The http-response source receives the responses for the calls made by its corresponding http-request sink, and maps them from formats such astext
,XML
andJSON
.
To handle messages with different http status codes having different formats, multiple http-response sources are allowed to associate with a single http-request sink. It allows accessing the attributes of the event that initiated the call, and the response headers and properties via transport properties in the formattrp:<attribute name>
andtrp:<header/property>
respectively.- http-service (Source)
The http-service source receives POST requests via HTTP and HTTPS protocols in format such as
text
,XML
andJSON
and sends responses via its corresponding http-service-response sink correlated through a uniquesource.id
.
For request and response correlation, it generates amessageId
upon each incoming request and expose it via transport properties in the formattrp:messageId
to correlate them with the responses at the http-service-response sink.
The request headers and properties can be accessed via transport properties in the formattrp:<header>
.
It also supports basic authentication to ensure events are received from authorized users/systems. - sse (Source)
HTTP SSE source send a request to a given url and listen to the response stream.
- websubhub (Source)
WebSub Hub source receive subscription requests via Http and according to the request, the subscription details will be saved to the given table and against the callback and topic name. The subscription request MUST have a Content-Type header of application/x-www-form-urlencoded and following MUST provide as parameter body.
hub.callback - REQUIRED. The subscriber's callback URL where content distribution notifications should be delivered. The callback URL SHOULD be an unguessable URL that is unique per subscription.
hub.mode - REQUIRED. The literal string "subscribe" or "unsubscribe", depending on the goal of the request.
hub.topic - REQUIRED. The topic URL that the subscriber wishes to subscribe to or unsubscribe from.
hub.lease_seconds - OPTIONAL. Number of seconds for which the subscriber would like to have the subscription active, given as a positive decimal integer.
hub.secret - OPTIONAL. A subscriber-provided cryptographically random unique secret string that will be used to compute an HMAC digest for authorized content distribution. If not supplied, the HMAC digest will not be present for content distribution requests.
Dependencies
There are no other dependencies needed for this extension.
Installation
For installing this extension on various siddhi execution environments refer Siddhi documentation section on adding extensions.
Support and Contribution
-
We encourage users to ask questions and get support via StackOverflow, make sure to add the
siddhi
tag to the issue for better response. -
If you find any issues related to the extension please report them on the issue tracker.
-
For production support and other contribution related information refer Siddhi Community documentation.