Tuesday 15 July 2014

performance - JMS queue consumer: synchronous receive() or single-threaded onMessage() -



performance - JMS queue consumer: synchronous receive() or single-threaded onMessage() -

i need consume q, , stamp sequence key on each message indicate ordering. i.e. consumption needs sequential. performance/throughput point of view, improve off using blocking receive() method, or async listener single-threaded configuration on onmessage() method?

thanks.

there many aspects impact performance , throughput; in pure jms terms it's not possible state sync or async model of getting messages less or more efficient. depend on big number of factors how application written, other resources it's using, implementation of chosen messaging provider , other factors such machine performance , configuration of both client , server machines.

this discussion, single vs multi-threaded jms producer, covered of these topics.

to sequence, if single threaded, single session jms specification gives assurances on message ordering; best review spec see if matches overall requirements.

often people insert application sequence number @ message production time; consumer can hence check getting right message in order. adding sequence number @ consumption time won't help consumer.

keep in mind stricter requirement messaging ordering more restrictive overall architecture gets , harder implement horizontal scalabilty.

performance queue order jms consumer

No comments:

Post a Comment