You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Timothy Bish (JIRA)" <ji...@apache.org> on 2008/08/22 17:28:52 UTC

[jira] Created: (AMQCPP-195) Message stuck in queue when using transactional sessions

Message stuck in queue when using transactional sessions
--------------------------------------------------------

                 Key: AMQCPP-195
                 URL: https://issues.apache.org/activemq/browse/AMQCPP-195
             Project: ActiveMQ C++ Client
          Issue Type: Bug
          Components: CMS Impl, Openwire
    Affects Versions: 2.2
         Environment: ActiveMQ-CPP 2.2 with ActiveMQ 5.1 Broker.
            Reporter: Timothy Bish
            Assignee: Nathan Mittler
             Fix For: 2.2.1


Here is what I have now done.

I used Examples/Producers/SimpleProducer.cpp to put 2000 messages onto the
queue TEST.FOO.

I then ran up Examples/Consumers/SimpleAsyncConsumer.cpp in it's default
autoack mode and it consumed all 2000 messages off the queue.

I then modified it and made the following changes:

In RunConsumer

            // Create a Session
/*
            if( clientAck ) {
                session = connection->createSession(
Session::CLIENT_ACKNOWLEDGE );
            } else {
                session = connection->createSession(
Session::AUTO_ACKNOWLEDGE );
            }
*/
            session = connection->createSession( Session::SESSION_TRANSACTED
);

This will force the session to be transactional

Then in onMessage

/*
            if( clientAck ) {
                message->acknowledge();
            }
*/
            this->session->commit();

When I then run the example - if looks like the messages are processed
normally but message #1 is left on the queue.  

If I run the exe a second time it outputs message #1 to standard out but
looking at the queue in jconsole the message is still there.

I can keep running the exe over and over and it outputs message#1 to stdout
but never removes it off the queue.  This is the situation I'm seeing in my
own project.

For completeness I went back to autoack and the message was consumed and
removed from the queue.

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


[jira] Resolved: (AMQCPP-195) Message stuck in queue when using transactional sessions

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish resolved AMQCPP-195.
---------------------------------

    Resolution: Fixed

Resolved in SVN 688553

> Message stuck in queue when using transactional sessions
> --------------------------------------------------------
>
>                 Key: AMQCPP-195
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-195
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: CMS Impl, Openwire
>    Affects Versions: 2.2
>         Environment: ActiveMQ-CPP 2.2 with ActiveMQ 5.1 Broker.
>            Reporter: Timothy Bish
>            Assignee: Timothy Bish
>             Fix For: 2.2.1
>
>
> Here is what I have now done.
> I used Examples/Producers/SimpleProducer.cpp to put 2000 messages onto the
> queue TEST.FOO.
> I then ran up Examples/Consumers/SimpleAsyncConsumer.cpp in it's default
> autoack mode and it consumed all 2000 messages off the queue.
> I then modified it and made the following changes:
> In RunConsumer
>             // Create a Session
> /*
>             if( clientAck ) {
>                 session = connection->createSession(
> Session::CLIENT_ACKNOWLEDGE );
>             } else {
>                 session = connection->createSession(
> Session::AUTO_ACKNOWLEDGE );
>             }
> */
>             session = connection->createSession( Session::SESSION_TRANSACTED
> );
> This will force the session to be transactional
> Then in onMessage
> /*
>             if( clientAck ) {
>                 message->acknowledge();
>             }
> */
>             this->session->commit();
> When I then run the example - if looks like the messages are processed
> normally but message #1 is left on the queue.  
> If I run the exe a second time it outputs message #1 to standard out but
> looking at the queue in jconsole the message is still there.
> I can keep running the exe over and over and it outputs message#1 to stdout
> but never removes it off the queue.  This is the situation I'm seeing in my
> own project.
> For completeness I went back to autoack and the message was consumed and
> removed from the queue.

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


[jira] Assigned: (AMQCPP-195) Message stuck in queue when using transactional sessions

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish reassigned AMQCPP-195:
-----------------------------------

    Assignee: Timothy Bish  (was: Nathan Mittler)

> Message stuck in queue when using transactional sessions
> --------------------------------------------------------
>
>                 Key: AMQCPP-195
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-195
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: CMS Impl, Openwire
>    Affects Versions: 2.2
>         Environment: ActiveMQ-CPP 2.2 with ActiveMQ 5.1 Broker.
>            Reporter: Timothy Bish
>            Assignee: Timothy Bish
>             Fix For: 2.2.1
>
>
> Here is what I have now done.
> I used Examples/Producers/SimpleProducer.cpp to put 2000 messages onto the
> queue TEST.FOO.
> I then ran up Examples/Consumers/SimpleAsyncConsumer.cpp in it's default
> autoack mode and it consumed all 2000 messages off the queue.
> I then modified it and made the following changes:
> In RunConsumer
>             // Create a Session
> /*
>             if( clientAck ) {
>                 session = connection->createSession(
> Session::CLIENT_ACKNOWLEDGE );
>             } else {
>                 session = connection->createSession(
> Session::AUTO_ACKNOWLEDGE );
>             }
> */
>             session = connection->createSession( Session::SESSION_TRANSACTED
> );
> This will force the session to be transactional
> Then in onMessage
> /*
>             if( clientAck ) {
>                 message->acknowledge();
>             }
> */
>             this->session->commit();
> When I then run the example - if looks like the messages are processed
> normally but message #1 is left on the queue.  
> If I run the exe a second time it outputs message #1 to standard out but
> looking at the queue in jconsole the message is still there.
> I can keep running the exe over and over and it outputs message#1 to stdout
> but never removes it off the queue.  This is the situation I'm seeing in my
> own project.
> For completeness I went back to autoack and the message was consumed and
> removed from the queue.

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


[jira] Commented: (AMQCPP-195) Message stuck in queue when using transactional sessions

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45134#action_45134 ] 

Timothy Bish commented on AMQCPP-195:
-------------------------------------

The problem is the call to commit in the onMessage callback which is in the context of the dispatch thread.  Calling commit here ends the transaction before the message has a chance to be added to the transaction, so the last message that you commit in the onMessage method will always be left out of the commit phase..

> Message stuck in queue when using transactional sessions
> --------------------------------------------------------
>
>                 Key: AMQCPP-195
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-195
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: CMS Impl, Openwire
>    Affects Versions: 2.2
>         Environment: ActiveMQ-CPP 2.2 with ActiveMQ 5.1 Broker.
>            Reporter: Timothy Bish
>            Assignee: Timothy Bish
>             Fix For: 2.2.1
>
>
> Here is what I have now done.
> I used Examples/Producers/SimpleProducer.cpp to put 2000 messages onto the
> queue TEST.FOO.
> I then ran up Examples/Consumers/SimpleAsyncConsumer.cpp in it's default
> autoack mode and it consumed all 2000 messages off the queue.
> I then modified it and made the following changes:
> In RunConsumer
>             // Create a Session
> /*
>             if( clientAck ) {
>                 session = connection->createSession(
> Session::CLIENT_ACKNOWLEDGE );
>             } else {
>                 session = connection->createSession(
> Session::AUTO_ACKNOWLEDGE );
>             }
> */
>             session = connection->createSession( Session::SESSION_TRANSACTED
> );
> This will force the session to be transactional
> Then in onMessage
> /*
>             if( clientAck ) {
>                 message->acknowledge();
>             }
> */
>             this->session->commit();
> When I then run the example - if looks like the messages are processed
> normally but message #1 is left on the queue.  
> If I run the exe a second time it outputs message #1 to standard out but
> looking at the queue in jconsole the message is still there.
> I can keep running the exe over and over and it outputs message#1 to stdout
> but never removes it off the queue.  This is the situation I'm seeing in my
> own project.
> For completeness I went back to autoack and the message was consumed and
> removed from the queue.

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