In general it works, but it is a little bit tricky i think.
First keep in mind that the message only holds the reference to your blob. It works for you with an URL becaus the publisher must not send the blob to the so called uploadurl. That url must point to the fileserver webapp (you can find it on the source-distribution). This webapp must be able to handle PUT http-Messages. So if you dont like the fileserver webapp which is made for jetty have a look at the code an write another one.

You can specify the url like this:
TopicPublisher publisher = new TopicPublisher("tcp://localhost:61616?jms.blobTransferPolicy.uploadUrl=http://localhost:8161/repository/";);

"jms.blobTransferPolicy.uploadUrl=http://localhost:8161/repository/"; tells the publischer to upload all blobs to the url "http://localhost:8161/repository/";.

I hope this helps a little bit. But notice at this point of time, the broker don“t delets the blob by itself after all consumers have processed the message. See Bug AMQ-1529: https://issues.apache.org/activemq/browse/AMQ-1529


CBT schrieb:
I'm trying to use ActiveMQ V5 to send and receive Blob messages this is a new
features with this version.

there are three ways to send these kind of messages :
file  :           BlobMessage message = session.createBlobMessage(new
File("c://mkv.txt"));
URL :           BlobMessage message = session.createBlobMessage(new
URL("http://127.0.0.1";));

stream :       InputStream inStream = new FileInputStream("c://mkv.txt");
                  BlobMessage message = session.createBlobMessage(inStream);

it works with URL
but it does not work with file or stream

the consumer sends a java.lang.NullPointerException but knows that it
receives an instance of Blob message

I'm quite disappointed, some other posts say that it does not work, is that
real ?

is there something I forgot ? is there something special to add or
configure, for file or stream ?



Reply via email to