ServerEventsClient uses its confiugred baseUrl to send APIs like UpdateEventSubscriber used in SubscribeToChannelsAsync, which also needs to be configured with the correct base URL.
Otherwise SubscribeToChannelsAsync is just an extension method for calling the UpdateEventSubscriber API which you can use with your own ServiceClient, e.g:
await sseClient.ServiceClient.PostAsync(
new UpdateEventSubscriber {
Id = sseClient.ConnectionInfo.Id,
SubscribeChannels = channels.ToArray()
});
sseClient.Update(channels);
Which you can use if with a custom Request DTO if you need to use a different route, e.g:
[Route("/sse/event-subscribers/{Id}")]
public class UpdateEventSubscriber : IPost,IReturn<UpdateEventSubscriberResponse>
{
public string Id { get; set; }
public string[] SubscribeChannels { get; set; }
public string[] UnsubscribeChannels { get; set; }
}
Should the client just work if the base uri is set up correctly, or are there other concrete steps too?
My goal is just to prefix all SSE related routes with “/sse”.
The UpdateEventSubscriber API wasn’t configurable before, but just added it in the latest v8.2.3+ now available in our Pre Release packages, where you’ll be able to configure it with: