You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Jinglong Wang <no...@gmail.com> on 2013/08/23 06:36:52 UTC

Some problem of BlobMessage

hi,everyone:
i have some problem to handle blobmessage.
My environments are:
Tomcat 6.0
Apache FTPServer 1.0.6
ActiveMQ 5.8.0

ActiveMQ message trans type is: publish/subcribe

now, i have a producer of publisher with topic and blobmessage,session mode
persistent,auto acknowledge.

the file size about 30MB,upload to ftp server with
policy:tcp://localhost:61616?jms.blobTransferPolicy.defaultUploadUrl=
ftp://localhost:21/.

then, client with subcriber to recive the blobmessage.

my problem is:
1. how to get the message status that downloaded file,recive success.
2. how and when delete the file from the blobmessage in ftp server.

newbie,thanks a lot

Re: Some problem of BlobMessage

Posted by cristisor <cr...@yahoo.com>.
To delete the file uploaded on the FTP server you can set the following on
the blob message consumer:
BlobTransferPolicy btp = new BlobTransferPolicy();
btp.setUploadUrl(blobMessage.getURL().toString());
BlobDownloadStrategy strategy = new FTPBlobDownloadStrategy(btp);
strategy.deleteFile(blobMessage);

This works for sure on a queue but on a topic you might have to test if the
first consumer which receives the file doesn't also delete it, and the next
consumers fail when trying to download it. Maybe ActiveMQ deletes the file
only after all the subscribers have received it, but I don't know for sure.

Regards,
Cristian.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Some-problem-of-BlobMessage-tp4670623p4671208.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.