I am experiencing a problem reading map messages with ActiveMQCPP 2.2.4 (we
also saw the problem in 2.2). If I through the ACTIVEMQ-CPP api create a map
message and send it, I can read the message just fine. The java producer
class can also consume his own messages without any problems. However, when
the java app that is using the 5.2 package and creates a map message, I
receive the message, but as soon as I try to either access any of the
fields, a CMS exception gets thrown and I get the following output from
printStackTrace():

DataInputStream::readFully - Reached EOF
        FILE: decaf/io/DataInputStream.cpp, LINE: 350
        FILE: decaf/io/DataInputStream.cpp, LINE: 357
        FILE: decaf/io/DataInputStream.cpp, LINE: 314
        FILE: activemq/connector/openwire/utils/OpenwireStringSupport.cpp,
LINE: 88
        FILE:
activemq/connector/openwire/marshal/PrimitiveMapMarshaller.cpp, LINE: 85
        FILE: activemq/connector/openwire/commands/ActiveMQMapMessage.cpp,
LINE: 120
        FILE: activemq/connector/openwire/commands/ActiveMQMapMessage.cpp,
LINE: 91
        FILE: activemq/connector/openwire/commands/ActiveMQMapMessage.cpp,
LINE: 325

This exception occurs on any operation involving get$TYPE(), itemExists(),
or getMapNames()

the calls getCMSTimestamp() getCMSMessageID() and getCMSType() work without
throwing exceptions. 


The message producer is on Linux using Java, I have tested my consumer code
mostly on Windows but can reproduce the issue on Linux as well (We feared an
issue with byte ordering in the DataInputStream read* classes, but that
doesn't appear to be the issue). 



Here is my onMessage function- I have tried reording the calls, checking if
the itemexists() first and many other permutations of these calls all with
the same result. 

Am I doing something wrong?

void 
JMSListener::onMessage( const Message* message )
{
    static int count = 0;

    try
    {
        count++;
        const MapMessage* mapMessage = dynamic_cast< const MapMessage* >(
message );

        
        if( mapMessage != NULL ) {
            
                        long secId = mapMessage->getLong("SECURITY.ID");
                        vector<std::string> names = mapMessage->getMapNames();
                        for(vector<std::string>::const_iterator it = 
names.begin(); it!=
names.end(); ++it)
                        {
                                LOG4CXX_INFO(logger, "Property: " << *it);
                        }
        } else {
           LOG4CXX_INFO(logger, "Received empty Map Message. " );
        }
                
                LOG4CXX_INFO(logger, "Message #" << count  );

    } 
        catch (CMSException& e) 
        {
        e.printStackTrace();
    }
}

-- 
View this message in context: 
http://www.nabble.com/Can-not-receive-map-messages-from-ActiveMQCPP-originated-from-Java-5.2-Producer--error-concerning-DataInputStream%3A%3AreadFully---Reached-EOF-tp22206906p22206906.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to