https://www.pgcasts.com/episodes/the-skip-locked-feature-in-...
It’s not “web scale” but it easily extends to several thousand background jobs in my experience
Then you probably have to write complicated queries or use partitions in some sort.
Or Just stick to one thread polling the messages.