activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Petrucci Andreas <petrucci_2...@hotmail.com>
Subject Interceptor to get messages text
Date Wed, 22 Dec 2010 16:00:54 GMT

Hi there, i have constructed an interceptor in order to get producers messages. the code is
below. 

public class mypluginBroker extends BrokerFilter {

public void send(ProducerBrokerExchange producer, Message message)
    throws Exception {
        
                    /*System.out.println("Message : " + message.toString());
                    
                    Configuration conf = new Configuration();
                     FileSystem fs = FileSystem.get(conf);

                     Path filenamePath = new Path("hello.txt");

                     try {
                       FSDataOutputStream out = fs.append(filenamePath);
                       System.out.println("Message Length : " + message.toString().length());
                       out.writeUTF(message.toString() );
                       out.close();}
                       catch (IOException ioe) {
                           System.err.println("IOException during operation: " + ioe.toString());
                           System.exit(1);
                         }
                    
                    super.send(producer, message);*/
             }

}


However what i do finally catch is at most an String of 806 characters like this : 

Message : ActiveMQTextMessage {commandId = 5, responseRequired = false, messageId = ID:dante-50013-1293033095353-0:1:1:1:1,
originalDestination = null, originalTransactionId = null, producerId = ID:dante-50013-1293033095353-0:1:1:1,
destination = queue://TEST.FOO, transactionId = null, expiration = 0, timestamp = 1293033095707,
arrival = 0, brokerInTime = 0, brokerOutTime = 0, correlationId = null, replyTo = null, persistent
= false, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
null, compressed = false, userID = null, content = null, marshalledProperties = null, dataStructure
= null, redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties = false, readOnlyBody
= false, droppable = false, text = M}

What I really want to get is the text field, but if the message size exceeds a certain size
then i cannot catch it? Any ideas?

thanks,
Petrucci
 		 	   		  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message