1) How are messages delivered to multiple consumer connections that registers message listeners? I assume it is round robin, isn't it?
Yes, but based on the smqp-consumer-cache-size (defined in the connection factory, default 500). Say, there are 2000 messages in the queue and you have 2 consumers with the same consuming speed. C#1 gets 1-500, C#2 501-1000, C#1 1001-1500, C#2 1501-2000.
The smqp-consumer-cache-size is very important for throughput and should stay at the default, except there is a good reason to change it.
Multiple consumers on a single queue creates more contention on the queue and will influence performance. A much better alternative is to use so-called
Local Clustering.
2) What happens when the onMessage() call is deferred and another message arrives.
The session delivery thread is blocked. There are 10 threads in client-side
session thread pool. So if you have multiple sessions, all waiting for onMessage to finish, this pool might run out of threads.