on 07-01-2009 7:01 AM
Hi,
I have an MDB which, on receipt of a message, generates more messages and posts them out to another queue.
However, I am finding that I am reaching a JMS Connection limit (very quickly), which results in the locking of the jms framework, as it waits for 60 seconds to try and get a new connection.
I am using the Spring Framework JmsTemplate to do the sending. It is created once, and the .send method is called multiple times.
I am aware of the jms settings in the admin tool, which are currently set to 100 for number of connections and 60 for connection delay.
I have 2 questions:
1) Is SAP Netweaver not pooling the jms connections correctly from a ConnectionFactory?
2) What is the recommended value for the jms connection limit?
Thanks.
Andrew
Hi Andrew
I have a question why do you need to open so many connections. Do you send the generated messages to several remote systems? I suppose that in onMessage(...) if you should open connection, send all the generated messages and then close the connection.
You can also use a @PostConstruct callback method to create the connection, and a @PreDestroy callback method to close the connection.
BR, Sergei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sergei,
I dont need that many connections. I only need one.
However, the SAP jms connection seems to go up everytime i send a message. ie it is not returning the same connection for use from the connection pool!
The jmsTemplate (or sender) only is created once and then told to send several messages, but instead the connections go up with the number of messages...
Andrew
Hi Sergei.
We use this class to send jms messages, as it allows a lot of other features that the native api does not have.
It just seems odd that all the connections are being used up...
I have a feeling though that the same thing would happen with all the native api calls.
This is all running on CE 7.1 SP6.
Regards,
Andrew
Sergei,
This code is called from the onMessage method: It will cause the problem.
private ConnectionFactory m_cf;
private Destination m_dest;
private final Log m_logger = LogFactory.getLog(getClass());
private Destination dest;
private JmsTemplate m_jt;
SimpleMessageDispatcher()
{
}
@SuppressWarnings("unchecked")
public void dispatch(Message message)
{
try
{
Connection c = m_cf.createConnection();
Session s = c.createSession(true, Session.AUTO_ACKNOWLEDGE);
MessageProducer p = s.createProducer(m_dest);
for (int i=0; i< 200; i++)
{
m_logger.info("Dispatching message:[" +i + "] to:[" + m_dest + "]");
try
{
sendJmsMessage(""+i,c,s,p);
}
catch (JMSException e)
{
// TODO Auto-generated catch block
m_logger.error("Error!!!",e);
}
}
}
catch(Exception e)
{
m_logger.error("Error in getting stuff....",e);
}
}
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.