I have integrated HorentQ-2.2.14.Final into Spring3.1 container.
I have very extreme latency problems while using jms template(in order to send messages) and DMLC(message listener consumer) while using the point to point(queue) hornetq structure.
this is very important note: when I use topic(pub-sub mode) the latency is reasonable.
I did measures of latency after warming up (1000000 messages)
the scenario is simple:
Sending via jms-template a simple message to queue. and in the other side I have DMLC retrieve the message.
I calculate the message deliver's latency at 2 points:
before sending and after retrieving.
the latency being calculated in miliseconds and it's about 8 mili-seconds for one simple execution. that considers ridiculous alot for doing almost nothing.
*all components are in the same application and jvm
I am considering checking another jms provider to negative Hornetq's mechanisem's problem but before I do that I wanted to make sure with you guys mybe I have configured something worng or should I pay attention to somethign else?
I have spoke with Spring support and that was their answer:
Tuning for jms would require not only on the consumer and producer but as well on the jms provider. I am not familiar with HornetQ there is a grey area on some extent on how I would understand messages are handled. Depends on how messages are persistented in queue, tendency is there is an IO/disk overhead that you may have to consider.
One of our products is ActiveMq and I have dealt with cases on slow consumers. I know both activemq and hornetq behaves differently but usually here are our recommendation on tuning consumers, this may or may not work with hornetQ.
> Setting the prefetch value to a lower value - try starting with 1. You may want to check hornetQ further on how it handles pre fetch handling/policies
> Check behaviour of concurrency of your consumers. Check if activeConsumers are scaling or reaching to maxConcurrentConsumer depends on the performance of both application/jms provider/number of messages. MaxConcurrentConsumers might need to be increased. You may either do this by adding additional logging or exposing the listener attributes and monitor it via jmx.
> Separate a cacheconnectionFactory for consumers. Create two cacheconnectionFactory - One for the producer and the consumer. So that we can make sure the producers does not affect consumers in terms of waiting time for connection on the pool.
> Additional logging when sending. Since you are using your own message id on messages it might help if you can add logging before you send the message. The HornetQMessage.toString seems not to provide any info with regards to messages send. No way to check contents of a message before sending and when it was received currently it only prints it as null.
2013-03-10 13:48:41,199 org.springframework.jms.core.JmsTemplate [DEBUG] Sending created message: HornetQMessage[null]:PERSISTENT
I have attached my configuration files.
thanks for your help,