SlideShare a Scribd company logo
Community Call - November 2021
Building Real-Time Systems with WebSub
In this presentation
Quick Overview of WebSub Protocol
Real-world Use Case of WebSub
Ballerina WebSub Framework
○ Open Protocol for distributed pub/sub communication.
○ Based on HTTP webhooks.
○ Main Roles:
○ Publisher
○ Subscriber
○ Hub
○ Specification: https://www.w3.org/TR/websub/
What is WebSub ?
WebSub Cont…
Use Case: News Hub
Scenario
○ News Hub is a centralized location to which the local journalists
and News channels connect.
○ Journalists will publish the news updates to the News Hub.
○ News Hub will then distribute the updates to the News channels
who are subscribed to the news feeds of the journalist.
News Hub Cont…
Demo
Ballerina WebSub
○ In Ballerina, WebSub implementation is divided into two packages:
○ WebSub:
○ Subscriber
○ WebSubHub:
○ Hub
○ Publisher
Ballerina WebSub: Hub API
public type Service distinct service object {
// Sample POST request hub.mode=register&hub.topic=http://foo.com/bar
// Sample 200 OK response hub.mode=accepted or 200 OK hub.mode=denied&hub.reason=unauthorized
remote function onRegisterTopic(websubhub:TopicRegistration msg)
returns websubhub:TopicRegistrationSuccess|websubhub:TopicRegistrationError|error;
// Sample POST request hub.mode=unregister&hub.topic=http://foo.com/bar
// Sample 200 OK response hub.mode=accepted or 200 OK hub.mode=denied&hub.reason=unauthorized
remote function onDeregisterTopic(websubhub:TopicDeregistration msg)
returns websubhub:TopicDeregistrationSuccess|websubhub:TopicDeregistrationError|error;
// Sample POST request with content type x-www-form-urlencoded hub.mode=publish&hub.topic=http://foo.com/bar
// for other content types such as xml, json and octect-stream hub.mode=publish should be in query string.
// Sample 200 OK response hub.mode=accepted or 200 OK hub.mode=denied&hub.reason=unauthorized
remote function onUpdateMessage(websubhub:UpdateMessage msg)
returns websubhub:Acknowledgement|websubhub:UpdateMessageError|error;
// Sample POST request hub.mode=subscribe&hub.topic=http://foo.com/bar
remote function onSubscription(websubhub:Subscription msg)
returns websubhub:SubscriptionAccepted|websubhub:SubscriptionPermanentRedirect|websubhub:SubscriptionTemporaryRedirect|
websubhub:BadSubscriptionError|websubhub:InternalSubscriptionError|error;
remote function onSubscriptionValidation(websubhub:Subscription msg) returns websubhub:SubscriptionDeniedError|error?;
remote function onSubscriptionIntentVerified(websubhub:VerifiedSubscription msg) returns error?;
// Sample POST request hub.mode=unsubscribe&hub.topic=http://foo.com/bar
remote function onUnsubscription(websubhub:Unsubscription msg)
returns websubhub:UnsubscriptionAccepted|websubhub:BadUnsubscriptionError|websubhub:InternalUnsubscriptionError|error;
remote function onUnsubscriptionValidation(websubhub:Unsubscription msg) returns websubhub:UnsubscriptionDeniedError|error?;
remote function onUnsubscriptionIntentVerified(websubhub:VerifiedUnsubscription msg) returns error?;
}
○ WebSub Specification: https://www.w3.org/TR/websub/
○ Ballerina WebSub Libraries:
○ WebSub
○ WebSubHub
○ Hub Sample:
https://github.com/ballerina-platform/module-ballerina-websubhub/tree/
main/examples/kafka-hub
References
Questions?
Thank you!

More Related Content

PPTX
Main Groups of Microservices
PDF
ATMOSPHERE Webinar: Combining Clouds with Fogbow (Francisco Brasileiro)
PDF
Information sharing pipeline
PPTX
Bhopal_MuleSoft_Meetup_12June2022_MuleSoft Transit Gateway - Overview and Dem...
PPT
Web 2.0: What Is It, How Can I Use It, How Can I Deploy It?
PPSX
WEB2.0 And CLOUD
PDF
Web Syndication with TYPO3 and ActivityPub
PDF
LoCloud - D3.3: Metadata Enrichment services
Main Groups of Microservices
ATMOSPHERE Webinar: Combining Clouds with Fogbow (Francisco Brasileiro)
Information sharing pipeline
Bhopal_MuleSoft_Meetup_12June2022_MuleSoft Transit Gateway - Overview and Dem...
Web 2.0: What Is It, How Can I Use It, How Can I Deploy It?
WEB2.0 And CLOUD
Web Syndication with TYPO3 and ActivityPub
LoCloud - D3.3: Metadata Enrichment services

Similar to Building Real-time Systems with WebSub - Ballerina Community Call - 11/30/2021 (20)

PDF
Crowd wales, Building a crowdsourcing platform for Wales by Paul McCann - Eur...
PDF
Simplifying Services with the Apache Brooklyn Catalog
PDF
Use the PnP SharePoint Starter Kit to create your intranet in a box
PDF
2018-10-17 J1 5D - Use the PnP SharePoint starter kit to create your Intranet...
PPTX
Web browser and web servers (WT)
PPTX
Montreal MuleSoft_Meetup_16-Aug.pptx
KEY
V2 online strategy
PPTX
CloudPresentation.pptx
PDF
TYPO3 Flow 2.0 in the field - webtech Conference 2013
PDF
Service Engineering, ZHAW for CeBIT
PPTX
MongoDB World 2018: Partner Talk - Red Hat: Deploying to Enterprise Kubernetes
PPT
Web 2.0: What Can It Offer The Research Community?
PDF
OpenStack Neutron Tutorial
PDF
substrate: A framework to efficiently build blockchains
PPTX
MuleSoft Meetup Roma - CloudHub Networking Stategies
PPT
An Introduction to Web 2.0
PPTX
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
PPTX
App Mashup GE: WireCloud - Startup Weekend
PPTX
Munich MulesSoft Meetup - Germany 08 Feb 2023
PPTX
WireCloud hands-on. FI-PPP-Liaison
Crowd wales, Building a crowdsourcing platform for Wales by Paul McCann - Eur...
Simplifying Services with the Apache Brooklyn Catalog
Use the PnP SharePoint Starter Kit to create your intranet in a box
2018-10-17 J1 5D - Use the PnP SharePoint starter kit to create your Intranet...
Web browser and web servers (WT)
Montreal MuleSoft_Meetup_16-Aug.pptx
V2 online strategy
CloudPresentation.pptx
TYPO3 Flow 2.0 in the field - webtech Conference 2013
Service Engineering, ZHAW for CeBIT
MongoDB World 2018: Partner Talk - Red Hat: Deploying to Enterprise Kubernetes
Web 2.0: What Can It Offer The Research Community?
OpenStack Neutron Tutorial
substrate: A framework to efficiently build blockchains
MuleSoft Meetup Roma - CloudHub Networking Stategies
An Introduction to Web 2.0
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
App Mashup GE: WireCloud - Startup Weekend
Munich MulesSoft Meetup - Germany 08 Feb 2023
WireCloud hands-on. FI-PPP-Liaison
Ad

More from Ballerinalang (20)

PDF
Managing dependencies in ballerina
PDF
[Ballerina Community Call] Language Integrated Queries
PDF
[Community Call] Ballerina Swan Lake HTTP Module Changes
PDF
Ballerina Community Call 8: Highlights of Ballerina Swan Lake and Introducing...
PDF
[GID Live] Automatic Microservices Observability with Ballerina
PDF
[GID Live] Open-Source Cloud-Native Programming Language
PDF
[Ballerina Community Call] Services and Network Communication Updates in Swan...
PDF
[Ballerina Community Call] Java Interoperability
PDF
[Ballerina Community Call] Data Access in Ballerina
PDF
Code to Kubernetes: Languages of Infrastructure
PDF
[Cloud DC Meetup] Cloud Native Development with Ballerina
PDF
[DevOps Pro Europe 2020] The Cloud-Native and DevOps Friendly Programming Lan...
PDF
[DevOps Pro Europe 2020] From Code to Cloud
PDF
[DeveloperWeek 2020] Conquering Network Distributed Applications Using Ballerina
PDF
[Cloud-Native and Kubernetes Meetup in Silicon Valley] Ballerina - Cloud Nati...
PDF
[Downtown San Jose DevOps Meetup] Ballerina - A Programming Language for Clou...
PDF
[DeveloperWeek Austin 2019] Microservices in Practice with Ballerina, Kuberne...
PDF
[ApacheCon NA 2019] Re-inventing Middleware in a Programming Language
PDF
[ApacheCon NA 2019] Conquering Network Distributed Applications Using the Bal...
PDF
[Java Colombo Meetup] The better java for Java microservices developers
Managing dependencies in ballerina
[Ballerina Community Call] Language Integrated Queries
[Community Call] Ballerina Swan Lake HTTP Module Changes
Ballerina Community Call 8: Highlights of Ballerina Swan Lake and Introducing...
[GID Live] Automatic Microservices Observability with Ballerina
[GID Live] Open-Source Cloud-Native Programming Language
[Ballerina Community Call] Services and Network Communication Updates in Swan...
[Ballerina Community Call] Java Interoperability
[Ballerina Community Call] Data Access in Ballerina
Code to Kubernetes: Languages of Infrastructure
[Cloud DC Meetup] Cloud Native Development with Ballerina
[DevOps Pro Europe 2020] The Cloud-Native and DevOps Friendly Programming Lan...
[DevOps Pro Europe 2020] From Code to Cloud
[DeveloperWeek 2020] Conquering Network Distributed Applications Using Ballerina
[Cloud-Native and Kubernetes Meetup in Silicon Valley] Ballerina - Cloud Nati...
[Downtown San Jose DevOps Meetup] Ballerina - A Programming Language for Clou...
[DeveloperWeek Austin 2019] Microservices in Practice with Ballerina, Kuberne...
[ApacheCon NA 2019] Re-inventing Middleware in a Programming Language
[ApacheCon NA 2019] Conquering Network Distributed Applications Using the Bal...
[Java Colombo Meetup] The better java for Java microservices developers
Ad

Recently uploaded (20)

PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
PPTX
Custom Software Development Services.pptx.pptx
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PPTX
"Secure File Sharing Solutions on AWS".pptx
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
Time Tracking Features That Teams and Organizations Actually Need
PPTX
Patient Appointment Booking in Odoo with online payment
PDF
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PDF
Website Design Services for Small Businesses.pdf
PDF
iTop VPN Crack Latest Version Full Key 2025
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
Tech Workshop Escape Room Tech Workshop
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PDF
STL Containers in C++ : Sequence Container : Vector
PPTX
Introduction to Windows Operating System
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Complete Guide to Website Development in Malaysia for SMEs
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
Custom Software Development Services.pptx.pptx
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
"Secure File Sharing Solutions on AWS".pptx
Wondershare Recoverit Full Crack New Version (Latest 2025)
Time Tracking Features That Teams and Organizations Actually Need
Patient Appointment Booking in Odoo with online payment
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
wealthsignaloriginal-com-DS-text-... (1).pdf
Why Generative AI is the Future of Content, Code & Creativity?
Website Design Services for Small Businesses.pdf
iTop VPN Crack Latest Version Full Key 2025
Advanced SystemCare Ultimate Crack + Portable (2025)
Tech Workshop Escape Room Tech Workshop
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
STL Containers in C++ : Sequence Container : Vector
Introduction to Windows Operating System
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Embracing Complexity in Serverless! GOTO Serverless Bengaluru

Building Real-time Systems with WebSub - Ballerina Community Call - 11/30/2021

  • 1. Community Call - November 2021 Building Real-Time Systems with WebSub
  • 2. In this presentation Quick Overview of WebSub Protocol Real-world Use Case of WebSub Ballerina WebSub Framework
  • 3. ○ Open Protocol for distributed pub/sub communication. ○ Based on HTTP webhooks. ○ Main Roles: ○ Publisher ○ Subscriber ○ Hub ○ Specification: https://www.w3.org/TR/websub/ What is WebSub ?
  • 5. Use Case: News Hub Scenario ○ News Hub is a centralized location to which the local journalists and News channels connect. ○ Journalists will publish the news updates to the News Hub. ○ News Hub will then distribute the updates to the News channels who are subscribed to the news feeds of the journalist.
  • 8. Ballerina WebSub ○ In Ballerina, WebSub implementation is divided into two packages: ○ WebSub: ○ Subscriber ○ WebSubHub: ○ Hub ○ Publisher
  • 9. Ballerina WebSub: Hub API public type Service distinct service object { // Sample POST request hub.mode=register&hub.topic=http://foo.com/bar // Sample 200 OK response hub.mode=accepted or 200 OK hub.mode=denied&hub.reason=unauthorized remote function onRegisterTopic(websubhub:TopicRegistration msg) returns websubhub:TopicRegistrationSuccess|websubhub:TopicRegistrationError|error; // Sample POST request hub.mode=unregister&hub.topic=http://foo.com/bar // Sample 200 OK response hub.mode=accepted or 200 OK hub.mode=denied&hub.reason=unauthorized remote function onDeregisterTopic(websubhub:TopicDeregistration msg) returns websubhub:TopicDeregistrationSuccess|websubhub:TopicDeregistrationError|error; // Sample POST request with content type x-www-form-urlencoded hub.mode=publish&hub.topic=http://foo.com/bar // for other content types such as xml, json and octect-stream hub.mode=publish should be in query string. // Sample 200 OK response hub.mode=accepted or 200 OK hub.mode=denied&hub.reason=unauthorized remote function onUpdateMessage(websubhub:UpdateMessage msg) returns websubhub:Acknowledgement|websubhub:UpdateMessageError|error; // Sample POST request hub.mode=subscribe&hub.topic=http://foo.com/bar remote function onSubscription(websubhub:Subscription msg) returns websubhub:SubscriptionAccepted|websubhub:SubscriptionPermanentRedirect|websubhub:SubscriptionTemporaryRedirect| websubhub:BadSubscriptionError|websubhub:InternalSubscriptionError|error; remote function onSubscriptionValidation(websubhub:Subscription msg) returns websubhub:SubscriptionDeniedError|error?; remote function onSubscriptionIntentVerified(websubhub:VerifiedSubscription msg) returns error?; // Sample POST request hub.mode=unsubscribe&hub.topic=http://foo.com/bar remote function onUnsubscription(websubhub:Unsubscription msg) returns websubhub:UnsubscriptionAccepted|websubhub:BadUnsubscriptionError|websubhub:InternalUnsubscriptionError|error; remote function onUnsubscriptionValidation(websubhub:Unsubscription msg) returns websubhub:UnsubscriptionDeniedError|error?; remote function onUnsubscriptionIntentVerified(websubhub:VerifiedUnsubscription msg) returns error?; }
  • 10. ○ WebSub Specification: https://www.w3.org/TR/websub/ ○ Ballerina WebSub Libraries: ○ WebSub ○ WebSubHub ○ Hub Sample: https://github.com/ballerina-platform/module-ballerina-websubhub/tree/ main/examples/kafka-hub References