High Performance JMS Messaging

前端 未结 4 950
再見小時候
再見小時候 2020-12-15 08:34

I read slides from this year\'s UberConf and one of the speakers is making the argument that Spring JMS adds a performance overhead to your message queue system, however I d

4条回答
  •  无人及你
    2020-12-15 09:12

    1) Spring templates open/close connections/sessions for each message sent/received. That's why it's slower. Most JMS implementations performs better when connections/session remain open so that they can use optimizations like message pre-fetching not to mention avoid the overhead of doing all the connection setup/tear down bits.

    2) Topics are generally slower if they are copying/replicating data to more than one consumer. This is just a matter of physics. If 10 megs of messages are queue sent to a queue, then only 10 megs of data need to be transmitted to consumers. While on topic, if you have 10 consumers, and you send 10 megs of data to it, then 100 megs of data have to transmitted to consumers. So, for most JMS implementations:

    • adding a consumer to a topic can only slow your consumption rate.
    • adding a consumer to a queue usually helps increase the dequeue rate.

提交回复
热议问题