WebSub Developers Guide
Overview
WebSub module provides a common mechanism for communication between publishers of any kind of Web content and their subscribers, based on HTTP webhooks.
Below is a list of tools required in WebSub:
Ballerina (Swan-Lake)
Any IDE (like Vs Code)
Kafka
Postman (any HTTP Client)
Git
Software setup
Download Kafka and install it.
Source code setup
For the code setup, clone the repository and follow the guidelines mentioned in the Code Contributions.
Importing and building
Open the hub and consolidator folders where
Ballerina.toml
is present.Open the command prompt from the same folder.
Run the command
bal build
to build the hub and consolidator.Open the project in VS Code either by
open with vs code
or fromFile -> Open Folder
.
Environment setup
Run Configure and run Kafka, update
KAFKA_BOOTSTRAP_NODE
inConfig.toml
to point to your Kafka.
Initialization and utilization of module
WebSub consists of consolidator and hub.
Consolidator should be started first,
Got to consolidator -> java -jar target/bin/<Jarname>
. (Config.toml should be in the same place where you are running this command).Start WebSub with the same approach.
The APIs can be tried with the help of kernel-websub-api.
Last updated