[
https://issues.apache.org/activemq/browse/AMQCPP-186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43836#action_43836
]
Eddie Epstein commented on AMQCPP-186:
--------------------------------------
Yes, a simple way to reproduce this problem is to use ProducerTool from the
Java distribution combined with ConsumerTool from Java and
simple_async_consumer from C++.
My testing has been done using AMQ v4.1.1.
Setup a producerMachine and a consumerMachine such that the consumer clock is
30 seconds ahead of the producer's clock.
Modify ProducerTool as follows:
{noformat}
public static void main(String[] args) {
ProducerTool producerTool = new ProducerTool();
+ producerTool.url = "tcp://consumerMachine:61616";
+ producerTool.subject="TEST.FOO";
+ producerTool.timeToLive=20000;
{noformat}
Modify the java ConsumerTool:
{noformat}
public static void main(String[] args) {
ConsumerTool consumerTool = new ConsumerTool();
+ consumerTool.subject = "TEST.FOO";
{noformat}
Run the java ConsumerTool on consumerMachine and then the java ProducerTool on
the producer machine. The messages are received by the consumer.
Stop the java ConsumerTool, start the C++ simple_async_consumer on the consumer
machine, and run the ProducerTool. No messages are received, but the JMX stats
on the broker will show all the messages as being delivered.
Change producer timeToLive to be 0 or greater than the time difference between
machines and the C++ consumer will work.
> 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.