Package org.apache.storm.jms.example
Class JsonTupleProducer
java.lang.Object
org.apache.storm.jms.example.JsonTupleProducer
- All Implemented Interfaces:
- Serializable,- JmsTupleProducer
A simple 
JmsTupleProducer that expects to receive
 JMS TextMessage objects with a body in JSON format.
 
 Ouputs a tuple with field name "json" and a string value
 containing the raw json.
 
 NOTE:  Currently this implementation assumes the text is valid
 JSON and does not attempt to parse or validate it.- Author:
- tgoetz
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoiddeclareOutputFields(OutputFieldsDeclarer declarer) Declare the output fields produced by this JmsTupleProducer.toTuple(javax.jms.Message msg) Process a JMS message object to create a Values object.
- 
Constructor Details- 
JsonTupleProducerpublic JsonTupleProducer()
 
- 
- 
Method Details- 
toTupleDescription copied from interface:JmsTupleProducerProcess a JMS message object to create a Values object.- Specified by:
- toTuplein interface- JmsTupleProducer
- Parameters:
- msg- - the JMS message
- Returns:
- the Values tuple, or null if the message couldn't be processed.
- Throws:
- javax.jms.JMSException
 
- 
declareOutputFieldsDescription copied from interface:JmsTupleProducerDeclare the output fields produced by this JmsTupleProducer.- Specified by:
- declareOutputFieldsin interface- JmsTupleProducer
- Parameters:
- declarer- The OuputFieldsDeclarer for the spout.
 
 
-