Single vs Multi-threaded JMS Producer

后端 未结 6 1177
我寻月下人不归
我寻月下人不归 2020-12-17 04:16

I wanted to see how much time difference would it make to use a multi-threaded producer instead of a single threaded one. I setup an ActiveMQ on my local machine, wrote a pr

6条回答
  •  忘掉有多难
    2020-12-17 05:10

    From a JMS application perspective you have written the application to multi-threaded; multiple sessions each with their own JMS producer objects being driven by separate threads. Assuming that your application has no contention on the resources such as locks etc that is good.

    In terms of how efficient it is then at sending messages is up to how efficiently implemented the JMS provider is, both in terms of client and server sides pieces. Are there any locks or contention within the JMS implementation? Maybe it's trying to send everything over the same socket - in which case there's contention. Or maybe there's some other lock.

    Maybe there's a lock server side on the underlying queue data structure server side.

    To answer your question really needs detailed knowledge of the specific JMS provider.

提交回复
热议问题