Hi,

try

((TextMessage)message).getText()

but there are better ways to achieve what your code is doing here.

Cheers
--
Dejan Bosanac
-----------------
FuseSource - The experts in open source integration and messaging.
Email: dej...@fusesource.com
Web: http://fusesource.com
Twitter:  http://twitter.com/dejanb
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net



2010/12/22 Petrucci Andreas <petrucci_2...@hotmail.com>:
>
> 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
>

Reply via email to