> For the complete documentation index, see [llms.txt](https://docs.openg2p.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openg2p.org/platform/platform-services/websub.md).

# WebSub

Shared WebSub hub used by OpenG2P products to register topics and deliver events to subscriber callbacks.

OpenG2P uses a [WebSub](https://www.w3.org/TR/websub/) hub as a shared delivery service. Publishers register a topic and post content to the hub. The hub verifies subscriber callbacks and delivers that content to them.

The hub is not part of the Registry application. Registry, and any other product that needs push delivery, calls the hub over HTTP. Commons Services deploys the MOSIP hub and consolidator.

## What the hub does

* Accepts topic registration from a publisher.
* Accepts subscriptions from callbacks and checks that the callback is controlled by the subscriber.
* Stores topic and subscriber changes as Kafka events.
* Delivers a publish to every verified subscriber of that topic.
* Signs each delivery with the subscriber's `hub.secret` when one was supplied.

The hub is stateless. The consolidator folds the Kafka events into the state that every hub instance reads. Both components are required.

## Who publishes

| Publisher            | What it sends                                             |
| -------------------- | --------------------------------------------------------- |
| Registry outgestion  | Approved register changes, after template transformation. |
| Registry Partner API | Asynchronous DCI `on-search` results for one partner.     |

Those products choose the topic name and the payload. Subscription, the callback challenge, and `X-Hub-Signature` are hub behaviour and are the same for every publisher.

## Pages

{% content-ref url="/pages/7dHQTqF3kS2l6VbCX2vK" %}
[Subscription and delivery](/platform/platform-services/websub/subscription.md)
{% endcontent-ref %}

{% content-ref url="/pages/GCDoHmcgYmkKIsrEyIFK" %}
[Deployment](/platform/platform-services/websub/deployment.md)
{% endcontent-ref %}

Registry uses of the hub:

{% content-ref url="/pages/SfsQOtHFbteKMi3f6DgY" %}
[Outgestion Pipeline](/products/registry/registry/design/outgestion-pipeline.md)
{% endcontent-ref %}

{% content-ref url="/pages/pHFvHyQhXwzc4g0bBuTs" %}
[DCI partner search](/products/registry/registry/design/partner-register-search/dci-search.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.openg2p.org/platform/platform-services/websub.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
