The input WebSocket event adapter is used to receive events via a WebSocket. You can specify the URL of a WebSocket, so that WSO2 products can receive events from it. The input WebSocket event adapter supports XML, JSON, and text type mappings. To use it you need to do the following configurations.
Excerpt | ||||
---|---|---|---|---|
| ||||
NOTE TO WRITERS: Add the TOC here.
|
...
- Log in to the product's management console and click Configure.
- Click Input Event Adaptors in the Event Processor Configs menu, and then click Add Input Event Adaptor.
Enter details as shown in the below example.
Click Add Event Adaptor.
...
Create an XML file with the following WebSocket Event Adapter event adapter configurations. Input event adapter implementation must start with
<inputEventAdaptor>
as the root element.Code Block language xml <inputEventAdaptor name="websocketInputAdaptor" statistics="disable" trace="disable" type="websocket" xmlns="http://wso2.org/carbon/eventadaptormanager"> <property name="websocket.server.url">ws://localhost:9099</property> </inputEventAdaptor>
Add the XML file to the
<PRODUCT_HOME>/repository/deployment/server/inputeventadaptors/
directory. Since hot deployment is enabled, you can simply add/remove files to deploy/undeploy from the server.
...
The configured input WebSocket event adapters are used in event builders. With input event adapter message properties, event builders are able to extract data from the incoming events to build the event streams. Following are the specific message properties of the input WebSocket event adapter.
The message properties of the input WebSocket event adapter are described below.
Property | Description |
---|---|
Topic | The topic that will be used to receive messages on the input WebSocket event adapter. This is optional. |
Input Mapping Type | The incoming event type to be mapped. The input WebSocket event adapter supports XML, JSON, and text type mappings. |