activemq的MapMessage的问题
我照着java的程序用vc做了一个activemq的客户端结果TextMessage类型可以接发,而MapMessage类型就只能发不能接
virtual void onMessage( const Message* message ){
static int count = 0;
try
{
count++;
const TextMessage* textMessage =
dynamic_cast< const TextMessage* >( message );
string text,sd,sd1,sd2,sd3;
if( textMessage != NULL ) {
// text = textMessage->getText();
sd3 = textMessage->getStringProperty("materialName");
sd=textMessage->getStringProperty("verifyOrderId");
sd1=textMessage->getStringProperty("supplierName");
sd2=textMessage->getStringProperty("vehicleCard");
text = "NOT A3333 TEXTMESSAGE!";
} else {
text = "NOT A TEXTMESSAGE!";
}
printf( "Message #%d Received: %s\n", count, text.c_str() );
} catch (CMSException& e) {
e.printStackTrace();
}
// No matter what, tag the count down latch until done.
doneLatch.countDown();
}
// If something bad happens you see it here as this class is also been
// registered as an ExceptionListener with the connection.
virtual void onException( const CMSException& ex AMQCPP_UNUSED) {
printf("CMS Exception occured. Shutting down client.\n");
}
以上是接收段源代码