Question about publish-subscribe pattern

Sorry for such a trivial question,

In NATS, publish-subscribe pattern is a fan-out pattern. How does the Resgate HTTP handles the result?

Does it simply pick 1 result? or does it aggregates all of the results?

Last question of yours got a quick reply. This time I was much slower.

But no problem with trivial questions. They need answers too :slight_smile:

Resgate will act only on the first reply to any request that it sends. So, there is no aggregation.

This means, having multiple services that responds to the same request would not be useful. However, it can be quite useful to use NATS queue groups to spread the load over multiple services. The go-res library supports this.

But be aware, while this sort of scaling works fine with call requests, it will need some special treatment when it comes to get requests - more specifically, the services must rely on the system.reset event to update resources instead of using change/add/remove events.

This sort of scaling has been used successfully in production. So for simplified scaling, it can surely be an option.

More about it in this thread:

Best regards,
Samuel