public class JsonTupleProducer extends Object implements JmsTupleProducer
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.Constructor and Description |
---|
JsonTupleProducer() |
Modifier and Type | Method and Description |
---|---|
void |
declareOutputFields(OutputFieldsDeclarer declarer)
Declare the output fields produced by this JmsTupleProducer.
|
Values |
toTuple(javax.jms.Message msg)
Process a JMS message object to create a Values object.
|
public Values toTuple(javax.jms.Message msg) throws javax.jms.JMSException
JmsTupleProducer
toTuple
in interface JmsTupleProducer
msg
- - the JMS messagejavax.jms.JMSException
public void declareOutputFields(OutputFieldsDeclarer declarer)
JmsTupleProducer
declareOutputFields
in interface JmsTupleProducer
declarer
- The OuputFieldsDeclarer for the spout.Copyright © 2023 The Apache Software Foundation. All rights reserved.