You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Haneef Ali (JIRA)" <de...@tuscany.apache.org> on 2009/05/14 07:30:45 UTC

[jira] Created: (TUSCANY-3024) JMS Session is not closed in TransportServiceInterceptor

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


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.


[jira] Commented: (TUSCANY-3024) JMS Session is not closed in TransportServiceInterceptor

Posted by "Haneef Ali (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-3024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12713076#action_12713076 ] 

Haneef Ali commented on TUSCANY-3024:
-------------------------------------

Hi,

Though this fixes the issue, I think it is not the most elegant way

This is how the flow looks like
        1) Create a session
        2) Invoke request
        3)  If response is needed then invoke response. Session is used only here. No need to unnecessarily create one before request


Correct fix would have been
     1)  Invoke request
     2)  If response is needed
               Create a session
               do processing
                close session

   

> 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.


[jira] Commented: (TUSCANY-3024) JMS Session is not closed in TransportServiceInterceptor

Posted by "hu wei (JIRA)" <de...@tuscany.apache.org>.
    [ 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.