HTTP Event Publisher
HTTP event publisher is used to publish events in XML, JSON or text formats via HTTP and HTTPS transports.
Creating a HTTP event publisher
For instructions on creating a HTTP event publisher, see Creating Alerts .
Configuring global properties
The following global properties can be set for the HTTP event publisher type in the <DAS_HOME>/repository/conf/input-event-adapters.xml
file. These properties apply to all the publishers of the http
type. If a global property available by default is removed, the default value of the property is considered.
Custom properties cannot be added as global properties.
Property Key | Description | Data Type | Default Value |
---|---|---|---|
minThread | The minimum number of threads (including idle threads) that should be available in the thread pool at a given time. | Integer | 8 |
maxThread | The maximum number of threads (including idle threads) that should be available in the thread pool at a given time. | Integer | 100 |
keepAliveTimeInMillis | The maximum number of milliseconds that idle threads should be kept alive when the total number of threads in the pool exceeds the number of cores in the machine. | Integer | 20000 |
jobQueueSize | The size of the queue that is used to hold events before they are forwarded to the event stream. | Integer | 10000 |
defaultMaxConnectionsPerHost | The maximum number of connections allowed per host configuration. | Integer | 50 |
maxTotalConnections | The maximum number of connections allowed overall. | Integer | 1000
|
Configuring adapter properties
Specify the Static and Dynamic Adapter Properties, when creating a HTTP event publisher using the management console as shown below.
After entering the above adapter properties, select the Message Format which you want to apply on the published events . Also, click Advanced to define custom output mappings based on the Message Format you selected. For more information on custom output mapping types, see Output Mapping Types .
You can also d efine the respective adapter properties of the event publisher based on the transport type within the <to>
element of the event publisher configuration in the <PRODUCT_HOME>/repository/deployment/server/eventpublishers/
directory as follows.
<eventPublisher name="HTTPOutputEventAdapter" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventpublisher"> .................... <to eventAdapterType="http"> <property name="http.client.method">HttpPost</property> <property name="http.username">admin</property> <property name="http.proxy.host">yourhost</property> <property name="http.proxy.port">8080</property> <property encrypted="true" name="http.password">kuv2MubUUveMyv6GeHrXr9il59ajJIqUI4eoYHcgGKf/BBFOWn96NTjJQI+wYbWjKW6r79S7L7ZzgYeWx7DlGbff5X3pBN2Gh9yV0BHP1E93QtFqR7uTWi141Tr7V7ZwScwNqJbiNoV+vyLbsqKJE7T3nP8Ih9Y6omygbcLcHzg=</property> <property name="http.headers">header1: value1, header2: value2</property> <property name="http.url">http://localhost:8080</property> </to> </eventPublisher>
The above adapter properties are described below.
Static adapter properties
Adapter Property | Description | Configuration file property | Example |
---|---|---|---|
Proxy Host | The proxy server host | http.proxy.host | yourhost |
Proxy Port | The proxy server port | http.proxy.port | 8080 |
HTTP Client Method | The standard HTTP client method | http.client.method | HttpPost |
Dynamic adapter properties
Adapter Property | Description | Configuration file property | Example |
---|---|---|---|
URL | The target HTTP/HTTPS URL | http.url | http://yourhost:8080/service or https://yourhost:8080/service |
Username | HTTP BasicAuth username | http.username | admin |
Password | HTTP BasicAuth password | http.password | admin |
Headers | Custom HTTP headers | http.headers | header1: value1, header2: value2 |
Related samples
For more information on http
event publisher type, see the following sample in WSO2 CEP Documentation.