Hello All,
I am sending a large file using an Active MQ output stream.  I would like to
set message properties on the messages that I am sendingout (they will be
the same for all messages for a particular file).  How can i do this?  Here
is my code snippet.  The reason I need to set properties is because this
file will be dropped in a certain directory after it reaches the queue on
the other machine.

                        activeMQOutputStream =
((ActiveMQConnection)connectionFactory.createConnection()).createOutputStream(queue);
            BufferedInputStream in = new BufferedInputStream(new
FileInputStream(returnFileName));
            
            //Couldn't get this working with the buffers... the char by char
read seems fine
            /*
            byte[] buf = new byte[32768]; // 32k buffer
            int c = 0;
            do {
                c = in.read(buf,0,32768);
                if (c > 0) activeMQOutputStream.write(buf,0,c);
            } while (c >= 0);
            */
            
            while ((value = in.read()) != -1)
            {
                activeMQOutputStream.write((char)value);
                }               
            
                        in.close();
                        activeMQOutputStream.flush();
                        activeMQOutputStream.close();

--
View this message in context: 
http://www.nabble.com/ActiveMQ-Outputstream-message-properties-t1807819.html#a4926668
Sent from the ActiveMQ - User forum at Nabble.com.

Reply via email to