activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MathxH <>
Subject CMS cannot receive the file content from JMS create BlobMessage contains file content
Date Fri, 06 Nov 2015 06:45:38 GMT
System Enviroment:

1.ActiveMQ broker version is 5.9.1  
2.CMS  version is 3.9.0  ---------------this version support BlobMessage
3.JMS version is 1.1

4. (1)java version is 1.8.0_40
    (2)java TM  SE rumtime enviroment (build 1.8.0_40-b26)
    (3)java HotSpot b4-bit server VM (build 25.40-b25,mixed mode)


Here is details:

I need to  transfer big files between different language clients (JMS and
CMS) with ActiveMQ,then, the issue comes to show:
    I use JMS create BlobMessage to send it with file.(producer) and use CMS
receive this BlobMessage(consumer) , CMS cannot get the file content.  I am
pretty sure that BlobMessage has sent to broker successfully and CMS can
receive this blobmessage (because I can get related Message Properties from
JMS),BUT!!,    CMS cannot get file Content.

JMS code snippet as follows:
        BlobMessage blobMessage = session.createBlobMessage(file);
        blobMessage.setStringProperty("FILE.NAME", file.getName());
        blobMessage.setLongProperty("FILE.SIZE", file.length());
        System.out.println("start send file:" + file.getName() + ",file
                + file.length() + " bytes");
        System.out.println("send complete:" + file.getName());

CMS code snippet as follows:
void onMessage( const Message* message ) {
      commands::ActiveMQBlobMessage* blobMessage =

		if (blobMessage)
			commands::Message* cmdMsg = (commands::Message*)blobMessage;
			if (cmdMsg)
				std::vector<unsigned char> properties =
				LIST_PROPERTIES  lstProperties;
				int nErr = ParseProperties(properties, lstProperties);
				if (nErr == 0)
					// get related properties
					getMessageHeader(lstProperties, header, nFileSize);

					if (nFileSize > 0)
						// get file content,but  vector fileContent size is always 
						std::vector<unsigned char> fileContent;
						fileContent = blobMessage->getContent();

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message