activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "tom@hostwebase.com" <...@hostwebase.com>
Subject Re: About Blob Message
Date Fri, 22 Jun 2007 23:20:40 GMT

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();
      }

/////////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
Done.
connection {
  session {
    messageCount{ count: 0 unit: count startTime: 1182554060219
lastSampleTime: 1182554060219 description: Number of messages exchanged }
    messageRateTime{ count: 0 maxTime: 0 minTime: 0 totalTime: 0
averageTime: 0.0 averageTimeExMinMax: 0.0 averagePerSecond: 0.0
averagePerSecondExMinMax: 0.0 unit: millis startTime: 1182554060220
lastSampleTime: 1182554060220 description: Time taken to process a message
(thoughtput rate) }
    pendingMessageCount{ count: 0 unit: count startTime: 1182554060219
lastSampleTime: 1182554060219 description: Number of pending messages }
    expiredMessageCount{ count: 0 unit: count startTime: 1182554060219
lastSampleTime: 1182554060219 description: Number of expired messages }
    messageWaitTime{ count: 0 maxTime: 0 minTime: 0 totalTime: 0
averageTime: 0.0 averageTimeExMinMax: 0.0 averagePerSecond: 0.0
averagePerSecondExMinMax: 0.0 unit: millis startTime: 1182554060219
lastSampleTime: 1182554060219 description: Time spent by a message before
being delivered }
durableSubscriptionCount{ count: 0 unit: count startTime: 1182554060219
lastSampleTime: 1182554060219 description: The number of durable
subscriptions }

    producers {
      producer queue://TEST.FOO {
        messageCount{ count: 0 unit: count startTime: 1182554060244
lastSampleTime: 1182554060244 description: Number of messages processed }
        messageRateTime{ count: 0 maxTime: 0 minTime: 0 totalTime: 0
averageTime: 0.0 averageTimeExMinMax: 0.0 averagePerSecond: 0.0
averagePerSecondExMinMax: 0.0 unit: millis startTime: 1182554060244
lastSampleTime: 1182554060244 description: Time taken to process a message
(thoughtput rate) }
        pendingMessageCount{ count: 0 unit: count startTime: 1182554060244
lastSampleTime: 1182554060244 description: Number of pending messages }
        messageRateTime{ count: 0 maxTime: 0 minTime: 0 totalTime: 0
averageTime: 0.0 averageTimeExMinMax: 0.0 averagePerSecond: 0.0
averagePerSecondExMinMax: 0.0 unit: millis startTime: 1182554060244
lastSampleTime: 1182554060244 description: Time taken to process a message
(thoughtput rate) }
        expiredMessageCount{ count: 0 unit: count startTime: 1182554060244
lastSampleTime: 1182554060244 description: Number of expired messages }
        messageWaitTime{ count: 0 maxTime: 0 minTime: 0 totalTime: 0
averageTime: 0.0 averageTimeExMinMax: 0.0 averagePerSecond: 0.0
averagePerSecondExMinMax: 0.0 unit: millis startTime: 1182554060244
lastSampleTime: 1182554060244 description: Time spent by a message before
being delivered }
 }
    }
    consumers {
      consumer queue://TEST.FOO1 {
        messageCount{ count: 0 unit: count startTime: 1182554060258
lastSampleTime: 1182554060258 description: Number of messages processed }
        messageRateTime{ count: 0 maxTime: 0 minTime: 0 totalTime: 0
averageTime: 0.0 averageTimeExMinMax: 0.0 averagePerSecond: 0.0
averagePerSecondExMinMax: 0.0 unit: millis startTime: 1182554060258
lastSampleTime: 1182554060258 description: Time taken to process a message
(thoughtput rate) }
        pendingMessageCount{ count: 0 unit: count startTime: 1182554060258
lastSampleTime: 1182554060258 description: Number of pending messages }
        messageRateTime{ count: 0 maxTime: 0 minTime: 0 totalTime: 0
averageTime: 0.0 averageTimeExMinMax: 0.0 averagePerSecond: 0.0
averagePerSecondExMinMax: 0.0 unit: millis startTime: 1182554060258
lastSampleTime: 1182554060258 description: Time taken to process a message
(thoughtput rate) }
        expiredMessageCount{ count: 0 unit: count startTime: 1182554060258
lastSampleTime: 1182554060258 description: Number of expired messages }
        messageWaitTime{ count: 0 maxTime: 0 minTime: 0 totalTime: 0
averageTime: 0.0 averageTimeExMinMax: 0.0 averagePerSecond: 0.0
averagePerSecondExMinMax: 0.0 unit: millis startTime: 1182554060258
lastSampleTime: 1182554060258 description: Time spent by a message before
being delivered }
      }
    }
  }
}



////////////////end/////////////////////
































-- 
View this message in context: http://www.nabble.com/How-to-send-file-using-ActiveMQ-tf3960326s2354.html#a11261565
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message