What's the best way to implement a publish/subscribe pattern?

Once subscribed in a channel, how can I receive the messages?

I'm thinking about receiving an endpoint in subscribing action, like subscribe(channel, URL), and in this API method you receive the message and decide what to do, but, in this case you cannot control the screen behavior.

So, can you suggest something to me?

You will need a middleware/broker to subscribe on your behalf and forward the messages to you. Kafka has a connector that can deliver messages either directly to a DB or via REST.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.