Topic creation

Topics are created dynamically when a client makes a subscription request. This is useful when you do not know the target API and/or query parameters in advance that will be used by the subscribers. When creating an app, you allow any client in possession of the app token to dynamically create a topic by performing a subscription request.

The clients are subscribed to a topic based on the elements of their subscription request, including the URL, query params and HTTP headers. If two requests targeting the same API, differ in one of its elements (e.g additional query param/header, different value for query param/header), clients will not be subscribed to the same topic.

For example, given the following subscription requests:

$ curl -v "https://streamdata.motwin.net/{{TARGET_API}}?X-Sd-Token={{APP_TOKEN}}" -H "Authorization: Bearer *123*"

$ curl -v "https://streamdata.motwin.net/{{TARGET_API}}?X-Sd-Token={{APP_TOKEN}}" -H "Authorization: Bearer *456*"

Streams dynamically creates two separate topics and trigger two polling requests, one for each header value.

Related Links