Spring Integration JMS 出站适配器事务控制
为了在启用事务的情况下使用jms实现消息的高性能生产,需要控制每个事务发送的消息量,数量越大性能越高,
是否可以通过以下方式控制事务:弹簧集成?
有人可能会建议使用聚合器,但这违背了目的,因为我不想让一条消息在队列上包含 X 个较小的消息,但实际上我的队列上有 X 个消息。
谢谢!
in order to reach high performance production of messages with jms with transactions enabled, one needs to control the amount of messages being sent on each transaction, the larger the number the higher the performance are,
is it possible to control transactions in such a way using spring integration ?
one might suggest using an aggregator, but that defeats the purpose because i dont want to have one message containing X smaller messages on the queue, but actually X messages on my queue..
Thanks !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道您的设置,但我会增加源上的并发消费者,而不是尝试调整出站适配器。什么样的数据源正在注入如此大量的数据?根据我的经验,通常生产者落后于发布者 - 除非两者都是 JMS/消息传递资源 - 就像桥的情况一样。在这种情况下,您将通过增加并发消费者来看到显着的改进,因为您专用了 n 个线程来接收消息并并行处理它们,并且每个线程将在其自己的“事务环境”中运行。
还值得注意的是,JMS没有指定传输机制,并且由代理来选择传输。如果您使用的是 activemq,您可以尝试使用明线与 amqp 进行试验,看看是否获得了所需的吞吐量。
I'm not aware of your setup, but I'd bump up the concurrent consumers on the source than try to tweak the outbound adapter. What kind of data source is pumping in this volume of data ? From my experience, usually the producer lags behind the publisher - unless both are JMS / messaging resources - like in the case of a bridge. In which case you will mostly see a significant improvement by bumping up the concurrent consumers, because you are dedicating n threads to receive messages and process them in parallel, and each thread will be running in its own "transaction environment".
It's also worthwhile to note that JMS does not specify a transport mechanism, and its unto the broker to choose the transport. If you are using activemq you can try experimenting with open wire vs amqp and see if you get the desired throughput.