ActiveMQ如何在数据库字段MSG中保存消息?

时间:2014-11-11 17:34:18

标签: activemq

我试图从一些内部统计数据中获取数据库中的消息文本,我使用了TextMessage,但我无法从数据库中的MSG字段获取对象。

WireFormat wireFormat = new OpenWireFormat();
ActiveMQTextMessage answer = new ActiveMQTextMessage();
String testString = "... BLOB(hex) data from MSG field used for test ...";
byte[] test =  new BigInteger(testString,16).toByteArray();
answer = (ActiveMQTextMessage) wireFormat.unmarshal(new ByteSequence(test));

和wireFormat始终返回null对象。 在服务器端我也使用了TextMessages和OpenWireFormat,当将BLOB转换为String时,我看到了id队列名称和其他数据,但是没有良好的格式化

如何从此字段获取ActiveMQTextMessage?

0 个答案:

没有答案