-
1. Re: New connection is created on each JMS message
gaohoward Jul 4, 2012 11:57 PM (in response to benxiong)I think you need configure your spring.
-
2. Re: New connection is created on each JMS message
benxiong Jul 5, 2012 12:03 AM (in response to gaohoward)org.springframework.jms.core.JmsTemplate's property connectionFactory is pointing to org.hornetq.jms.client.HornetQJMSConnectionFactory, whose connectorConfig is a org.hornetq.api.core.TransportConfiguration with org.hornetq.core.remoting.impl.netty.NettyConnectorFactory.
I have checked the options for NettyConnectorFactory and do not see any options for connection pool.
-
3. Re: New connection is created on each JMS message
gaohoward Jul 5, 2012 12:06 AM (in response to benxiong)1 of 1 people found this helpfulYou are right HornetQ's factory doesn't provide pooling. You need Spring's pool configuration IMO.
-
4. Re: New connection is created on each JMS message
benxiong Jul 5, 2012 2:31 AM (in response to gaohoward)Yah, in Spring, one can use JEE managed connection pool or use CachingConnectionFactory as described in the following article:
-
5. Re: New connection is created on each JMS message
jbertram Jul 5, 2012 9:38 AM (in response to benxiong)Also see this article about using the Spring JMSTemplate with JBoss Messaging. It applies to HornetQ (or any message broker) as well.
-
6. Re: New connection is created on each JMS message
benxiong Jul 9, 2012 4:24 AM (in response to jbertram)Seems only ONE connection is established for all sessions and messages. Although it's already much faster, but still one connection can send around 30 messages/second (LAN).
Tomcat + Spring seems no solution for multi connections? I have to drop tomcat? If so, I have to say ActiveMQ is attractive in this case because HornetQ is fast but who cares if I cannot even connect to it with so popular Tomcat?
-
7. Re: New connection is created on each JMS message
jbertram Jul 9, 2012 9:50 AM (in response to benxiong)I'm not a Spring expert, but I don't believe this is an issue with HornetQ. Spring is managing the connections to HornetQ so if there is only 1 connection available then I believe that would be a Spring code/configuration issue. My guess is that this same problem would exist if you tried to integrate with ActiveMQ or any other JMS provider for that matter.
-
8. Re: New connection is created on each JMS message
benxiong Jul 10, 2012 6:45 AM (in response to jbertram)I'm not trying to argue but actually ActiveMQ does offer
org.apache.activemq.pool.PooledConnection
That's why I was trying to find it in HornetQ. Spring seems failed to deliver a replacement for JEE JMS connection pool.