org.apache.flume.source.jms
Class DefaultJMSMessageConverter

java.lang.Object
  extended by org.apache.flume.source.jms.DefaultJMSMessageConverter
All Implemented Interfaces:
JMSMessageConverter

public class DefaultJMSMessageConverter
extends Object
implements JMSMessageConverter

Converts BytesMessage, TextMessage, and ObjectMessage to a Flume Event. All Message Property names are added as headers to the Event. The conversion of the body is as follows:

BytesMessage: Body from message is set as the body of the Event.

TextMessage: String body converted to a byte array byte getBytes(charset). Charset defaults to UTF-8 but can be configured.

ObjectMessage: Object is written to an ByteArrayOutputStream wrapped by an ObjectOutputStream and the resulting byte array is the body of the message.


Nested Class Summary
static class DefaultJMSMessageConverter.Builder
           
 
Method Summary
 List<Event> convert(javax.jms.Message message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

convert

public List<Event> convert(javax.jms.Message message)
                    throws javax.jms.JMSException
Specified by:
convert in interface JMSMessageConverter
Throws:
javax.jms.JMSException


Copyright © 2009-2013 Apache Software Foundation. All Rights Reserved.