[ 
https://issues.apache.org/jira/browse/TUSCANY-3024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712834#action_12712834
 ] 

hu wei commented on TUSCANY-3024:
---------------------------------

    public Message invokeResponse(Message msg) { 
        Session session = null;
        try {
            JMSBindingContext context = msg.getBindingContext();
            session = context.getJmsSession();
            javax.jms.Message requestJMSMsg = context.getJmsMsg();
            javax.jms.Message responseJMSMsg = msg.getBody();
            

            if (requestJMSMsg.getJMSReplyTo() == null) {
                // assume no reply is expected
                if (msg.getBody() != null) {
                    logger.log(Level.FINE, "JMS service '" + service.getName() 
+ "' dropped response as request has no replyTo");
                }
                return msg;
            }
            
            
responseJMSMsg.setJMSDeliveryMode(requestJMSMsg.getJMSDeliveryMode());
            responseJMSMsg.setJMSPriority(requestJMSMsg.getJMSPriority());
    
            if (correlationScheme == null || 
                
JMSBindingConstants.CORRELATE_MSG_ID.equalsIgnoreCase(correlationScheme)) {
                
responseJMSMsg.setJMSCorrelationID(requestJMSMsg.getJMSMessageID());
            } else if 
(JMSBindingConstants.CORRELATE_CORRELATION_ID.equalsIgnoreCase(correlationScheme))
 {
                
responseJMSMsg.setJMSCorrelationID(requestJMSMsg.getJMSCorrelationID());
            }                
                       
            MessageProducer producer = 
session.createProducer(context.getReplyToDestination());
    
            producer.send((javax.jms.Message)msg.getBody());
    
            producer.close();
            return msg;
    
        } catch (JMSException e) {
            throw new JMSBindingException(e);
        } finally {
            if (session!=null) {
                try {
                    session.close();
                } catch (JMSException e) {
                    throw new JMSBindingException(e);
                }
            }
        }
    }    

> JMS Session is not closed in TransportServiceInterceptor
> --------------------------------------------------------
>
>                 Key: TUSCANY-3024
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-3024
>             Project: Tuscany
>          Issue Type: Bug
>    Affects Versions: Java-SCA-1.4
>         Environment: All version
>            Reporter: Haneef Ali
>   Original Estimate: 0.17h
>  Remaining Estimate: 0.17h
>
> Hi
> My JMS message doesn't  have any replyTo field.  After processing more than 
> 50K message I used to get  OutOfMemoroy error. Debugged the code and found 
> that none of the session is closed in the ServiceInterceptor side. This is 
> causing memory leak
> Thanks,
> Haneef

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to