12.4 使用二进制消息

博客已更新, 更好阅读体验, 猛戳 http://www.jack-yin.com/coding/translation/activemq-in-action/1759.html

12.4 Blob messages

12.4 使用二进制消息

ActiveMQ introduced the concept of blob messages so that users can take advantage of

ActiveMQ message delivery semantics (transactions, load balancing, and smart routing)

in conjunction with very large messages. A blob message doesn’t contain the data

being sent, but is a notification that a blob (binary large object) is available. The blob

itself is transferred out of bounds, by either FTP or HTTP. In fact, an ActiveMQ

BlobMessage only contains the URL to the data itself, with a helper method to grab an

InputStream to the real data. Let’s work through an example.

ActiveMQ引入了二进制消息的概念,这样用户可以将消息分发的语义(传输连接,负载均衡和智能路由)

同超大尺寸消息结合起来.二进制消息并不包含要发送的数据,而是通知要发送的二进制数据

(大尺寸二进制对象)已经准备完成了.二进制对象本身是在消息之外传输的,通过FTP或者HTTP传输.

事实上,ActiveMQ的二进制消息仅包含二进制数据的URL,通过一个助手方法可以抓取InputStream

进而获取真正的二进制数据.下面让我们通过实例来讲解.

.............................

猜你喜欢

转载自jackyin5918.iteye.com/blog/1993125