betfair / cougar

Cougar is a framework for making building network exposed service interfaces easy.
http://betfair.github.io/cougar
Apache License 2.0
27 stars 18 forks source link

Memory leak in JMSEventTransportImpl client #35

Closed eswdd closed 10 years ago

eswdd commented 10 years ago

Looking into Cougar source code (EventPublisherRunnable class from JMSEventTransportImpl.java, sonic-transport module) I saw that the MessageProducer objects are never closed: public void run() { try { Session session = sessionManager.get(); Destination destination = createDestination(session, destinationName); MessageProducer messageProducer = session.createProducer(destination); TextMessage textMessage = getEventMarshaller().marshallEvent(descriptor, event, session); messageProducer.send(textMessage, textMessage.getJMSDeliveryMode(), textMessage.getJMSPriority(), textMessage.getJMSExpiration()); success = true; } catch (CougarFrameworkException cfe) { // Catch possible exception thrown from session creation success = false; error = cfe; } catch (JMSException ex) { // Catch any other exception thrown during message publication success = false; error = ex; } finally { unlock(); } }