Long-polling workers

Why do workers use Long polling instead of publish-subscribe model like message queue?

Long polling is almost equal to publish-subscribe.

You have either push or pull.

If the method is push, then the server needs to initiate an outbound connection to the client, which means that the server needs knowledge of the clients. To connect to the server, the clients need knowledge of the server.

With pull, the clients need to know about the server, and the server needs no knowledge about clients. This makes the server more simple because it does not need to manage the state of clients connected to it.

Zeebe went with the more simple of the two designs.

1 Like

However, long polling needs to constantly ask the server if there is data, which will lead to low efficiency and waste network resources. How does zeebe solve this problem?

It seems you do not understand what is long polling, it is query once in longpolling interval and two directional exchange

1 Like

Thanks, I am learning this.
Also, why not use websocket

Related What's the reason for choosing polling over a WebSocket connection for job workers

1 Like