hono
hono copied to clipboard
[AMQP] Ensure Command Router forwards commands in same order they got received
When developing Kafka support in the Command Router, it was made sure that commands get forwarded to the protocol adapter (by publishing on the command_internal topic) in the same order they were received (see KafkaCommandProcessingQueue).
One command getting ahead of another command could be due to differing times the Infinispan requests take (for determining the target adapter instance), for example.
When doing load-tests, one can see that the mechanism to correct the order gets applied quite often:
08:58:54.001 [vert.x-eventloop-thread-3] DEBUG o.e.h.c.i.k.KafkaCommandProcessingQueue - sending of command with offset 382224 gets delayed; waiting for processing of offset 382222 [queue size: 3; delayed Command [name: testCommandRequestResponse, tenant-id: tloadtesttenant27, device-id: loadTestClient-1786, request-id: 2043834]]
Therefore, the logic should also be adopted for dealing with commands received via the AMQP messaging network.