Package org.apache.storm.jms

# Interface JmsTupleProducer

All Superinterfaces:
  `Serializable`

All Known Implementing Classes:
  `JsonTupleProducer`

public interface JmsTupleProducer extends Serializable
Interface to define classes that can produce a Storm `Values` objects from a `javax.jms.Message` object>.

Implementations are also responsible for declaring the output fields they produce.

If for some reason the implementation can't process a message (for example if it received a `javax.jms.ObjectMessage` when it was expecting a `javax.jms.TextMessage` it should return `null` to indicate to the `JmsSpout` that the message could not be processed.

- ## Method Summary

  Modifier and Type
  Method
  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.

- ## Method Details

  - ### toTuple

    Values toTuple(javax.jms.Message msg) throws javax.jms.JMSException
    Process a JMS message object to create a Values object.
    Parameters:
      `msg` - - the JMS message
    Returns:
      the Values tuple, or null if the message couldn't be processed.
    Throws:
      `javax.jms.JMSException`

  - ### declareOutputFields

    void declareOutputFields(OutputFieldsDeclarer declarer)
    Declare the output fields produced by this JmsTupleProducer.
    Parameters:
      `declarer` - The OuputFieldsDeclarer for the spout.