activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: About Blob Message
Date Mon, 25 Jun 2007 06:46:08 GMT
On 6/23/07, tom@hostwebase.com <tom@hostwebase.com> wrote:
>
> Hi,
>
> I still have problem. I appreciate your help.
>
> Here is the code that I use to send large file (it's part of the file
> ConsumerTool.java, it send out file after receiving message from
> RequestTool.java
>
> //////////begin/////////////
>
> if (message.getJMSReplyTo() != null) {
>         activeMQSession = (ActiveMQSession)session;
>         message1 = activeMQSession.createBlobMessage(new
> File("/tmp/0/testFile.exe"));
>         replyProducer.send(message1);
>         message1.acknowledge();
>       }

FWIW you only acknowledge messages you consume.


> /////////end////////////////
>
>
> Here is the code that I use to receive large file (it's part of the file
> RequestTool.java)
>
> ////////////begin////////////
>
> message1 = consumer.receive();
>     if (message1 instanceof BlobMessage) {
>       blobMessage = (BlobMessage) message1;
>       in = blobMessage.getInputStream();
>       fout = new FileOutputStream("/tmp/testFile.exe");
>       while((i = in.read(fileData)) != -1) {
>         fout.write(fileData, 0, i);
>       }
>       fout.close();
>     } else {
>       System.out.println("Wrong, please send file: ");
>     }
>
> ////////////end/////////////
>
>
> This is the error that I receive on the side that receive large file
> (RequestTool.java)
>
> /////////////////////begin////////////////
>
> Error occur: [Ljava.lang.StackTraceElement;@187814

No other stack trace?

-- 
James
-------
http://macstrac.blogspot.com/

Mime
View raw message