Client: DiscoveryService

Represents resource-discovery service which identify the hub and topic from resource-URL.

Constructor

Invoked during the initialization of a websub:DiscoveryService

init (string discoveryUrl, ClientConfiguration? publisherClientConfig)
  • publisherClientConfig ClientConfiguration?
  • {@code http:ClientConfiguration} if present to be used to initialize underlying {@code http:Client}

Remote Methods

discoverResourceUrls

Discovers the hub and topic URLs defined by a resource URL.

discoverResourceUrls

function discoverResourceUrls(string? | string[ ] expectedMediaTypes, string? | string[ ] expectedLanguageTypes) returns [string, string] | error
Isolated Function
Remote Function

Discovers the hub and topic URLs defined by a resource URL.

Parameters

  • expectedMediaTypes string? | string[ ]
  • The expected media types for the subscriber client

  • expectedLanguageTypes string? | string[ ]
  • The expected language types for the subscriber client

Return Type

([string, string] | error)

A (hub, topic) as a (string, string) if successful or else an error if not