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/07/01 14:16:00 UTC

[jira] Commented: (AMQCPP-186) CMSExpiration computed incorrectly (?)

    [ https://issues.apache.org/activemq/browse/AMQCPP-186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43819#action_43819 ] 

Timothy Bish commented on AMQCPP-186:
-------------------------------------

If you could provide C++ and Java sample code to reproduce the problem that would be helpful.  The C++ isExpired code looks like this:

{noformat} 

        virtual bool isExpired() const {
            long long expireTime = this->getCMSExpiration();
            long long currentTime = decaf::util::Date::getCurrentTimeMilliseconds();
            if( expireTime > 0 && currentTime > expireTime ) {
                return true;
            }
            return false;
        }

{noformat} 

And the Java code

{noformat} 

    public boolean isExpired() {
        long expireTime = this.getExpiration();
        if (expireTime > 0 && System.currentTimeMillis() > expireTime) {
            return true;
        }
        return false;
    }

{noformat} 



> CMSExpiration computed incorrectly (?)
> --------------------------------------
>
>                 Key: AMQCPP-186
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-186
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 2.1.3
>            Reporter: Eddie Epstein
>            Assignee: Nathan Mittler
>
> The C++ consumer is treating messages as expired in situations where the Java consumer is not.
> It could be that the problem is due to the code in connector/openwire/commands/ActiveMQMessageBase.h which compares the CMSExpiration time specified by producer.setTimeToLive()  with the local clock on the consumer machine.
>         /**
>          * Returns if this message has expired, meaning that its
>          * Expiration time has elapsed.
>          * @returns true if message is expired.
>          */
>         virtual bool isExpired() const {
>             long long expireTime = this->getCMSExpiration();
>             long long currentTime = decaf::util::Date::getCurrentTimeMilliseconds();
>             if( expireTime > 0 && currentTime > expireTime ) {
>                 return true;
>             }
>             return false;
>         }

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