Interoperability issues between C++ and .NET
--------------------------------------------
Key: AMQCPP-157
URL: https://issues.apache.org/activemq/browse/AMQCPP-157
Project: ActiveMQ C++ Client
Issue Type: Bug
Reporter: Nathan Mittler
Assignee: Nathan Mittler
Fix For: 2.2
Attachments: ActiveMQ+Issue.ZIP
Taken from
http://www.nabble.com/ActiveMQ-thoughts-to14262131s2354.html#a14278412
As promised I have created a c++ test program (TestProducerBug) that will
create up to X producers. The class that does the work is
(TestProducers.cpp).
I am created a C# test program (TestConsumerBugCSharp) that will create up
to X consumers using a MessageListener. The class that does the work is
(TestConsumers.cs).
I have created a C++ test program (TestConsumerBug) that will create up to X
consumers. The class that does the work(TestConsumers.cpp).
Here is some information on my setup.
Compiler MS 2005.
ActiveMQ
Running ActiveMQ 5.0 Dated Dec 7th 2007. It is running on windows 2003
Server 64 Bit.
Running Java 1.6.0_02 this version of Java is 64 bit. (Problem happens even
on a 32 bit version of JAVA).
ActiveMQ Settings
Broker Settings (persistent="false" advisorySupport="false")
Topic Policy
<policyEntry topic="Test.>" producerFlowControl="true">
<!-- lets force old messages to be discarded for slow consumers
-->
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="5"/>
</pendingMessageLimitStrategy>
<messageEvictionStrategy>
<oldestMessageEvictionStrategy />
</messageEvictionStrategy>
</policyEntry>
Client API's
CPP activemq-cpp-2.1.2-src
C# ApacheActiveMQ (Not sure the version but latest trunk).
When running these test remember to stop and restart the broker each test as
the test can and will cause the broker to hang.
Tests 1 -3 will show what is happening between the CPP and C# API.
Test 4 will show what happens to a producer when a consumer is in a break
point in the MessageListener.
Test 1
To recreate the issue build and run
TestProducerBug
TestConsumerBugCSharp.
If you set the number of producers and clients to 10 you should see the
problem happen in less then 5 min (About 2,000 messages per consumer).
The producer will throw an exception place a breakpoint on the catch block
in the ThreadProc. you will see the following information.
No valid response received for command: Begin Class = ActiveMQBytesMessage
Begin Class = ActiveMQMessageBase
Value of ackHandler = 00000000
Value of redeliveryCount = 0
Value of properties = Begin Class PrimitiveMap:
Begin Class PrimitiveMap:
Begin Class = Message
Value of Message::ID_MESSAGE = 0
Value of ProducerId is Below:
Begin Class = ProducerId
Value of ProducerId::ID_PRODUCERID = 123
Value of ConnectionId = 752afa01-c256-45c2-84ad-c74b0578f199
Value of Value = 19
Value of SessionId = 0
No Data for Class BaseDataStructure
End Class = ProducerId
Value of Destination is Below:
Begin Class = ActiveMQTopic
Begin Class = ActiveMQDestination
Value of exclusive = false
Value of ordered = false
Value of advisory = false
Value of orderedTarget = coordinator
Value of physicalName = Test.20
Value of options = Begin Class activemq::util::Properties:
End Class activemq::util::Properties:
No Data for Class BaseDataStructure
End Class = ActiveMQDestination
End Class = ActiveMQTopic
Value of TransactionId is Below:
Object is NULL
Value of OriginalDestination is Below:
Object is NULL
Value of MessageId is Below:
Begin Class = MessageId
Value of MessageId::ID_MESSAGEID = 110
Value of ProducerId is Below:
Begin Class = ProducerId
Value of ProducerId::ID_PRODUCERID = 123
Value of ConnectionId = 752afa01-c256-45c2-84ad-c74b0578f199
Value of Value = 19
Value of SessionId = 0
No Data for Class BaseDataStructure
End Class = ProducerId
Value of ProducerSequenceId = 19025
Value of BrokerSequenceId = 0
No Data for Class BaseDataStructure
End Class = MessageId
Value of OriginalTransactionId is Below:
Object is NULL
Value of GroupID =
Value of GroupSequence = 0
Value of CorrelationId =
Value of Persistent = 0
Value of Expiration = 1197392556357
Value of Priority = 4
Value of ReplyTo is Below:
Object is NULL
Value of Timestamp = 1197392551357
Value of Type =
Value of Content[0] =
Value of Content[1] = , check broker.
FILE: ..\src\main\activemq\transport\filters\ResponseCorrelator.cpp, LINE:
146
FILE: ..\src\main\activemq\transport\filters\ResponseCorrelator.cpp, LINE:
154
FILE: ..\src\main\activemq\connector\openwire\OpenWireFormatNegotiator.cpp,
LINE: 105
FILE: ..\src\main\activemq\connector\openwire\OpenWireConnector.cpp, LINE:
1371
FILE: ..\src\main\activemq\connector\openwire\OpenWireConnector.cpp, LINE:
848
FILE: ..\src\main\activemq\core\ActiveMQSession.cpp, LINE: 675
FILE: ..\src\main\activemq\core\ActiveMQProducer.cpp, LINE: 194
FILE: ..\src\main\activemq\core\ActiveMQProducer.cpp, LINE: 149
FILE: ..\src\main\activemq\core\ActiveMQProducer.cpp, LINE: 108
Test 2
Now if you build and run
TestProducerBug
TestConsumerBug
These tests both use the C++ API and works as expected
Test 3
In the CPP program TestProducerBug you will find a sleep commented out in
the ThreadProc uncomment this line. Build Program.
Build TestConsumerCSharp.
You will find with the 100 ms sleep the application is stable.
Test 4
Build TestProducerBug remember to comment out the sleep
Build TestConsumerCSharp.
Place a breakpoint on the MessageListner in the C# program.
In very little time the producer will throw an exception.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.