public class TridentJmsSpout extends Object implements ITridentSpout<JmsBatch>
ITridentSpout.BatchCoordinator<X>, ITridentSpout.Emitter<X>
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BATCH_SIZE |
static String |
MAX_BATCH_SIZE_CONF |
Constructor and Description |
---|
TridentJmsSpout()
Create a TridentJmsSpout with a default name and acknowledge mode of AUTO_ACKNOWLEDGE.
|
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
getComponentConfiguration() |
ITridentSpout.BatchCoordinator<JmsBatch> |
getCoordinator(String txStateId,
Map<String,Object> conf,
TopologyContext context)
The coordinator for a TransactionalSpout runs in a single thread and indicates when batches of tuples should be
emitted.
|
ITridentSpout.Emitter<JmsBatch> |
getEmitter(String txStateId,
Map<String,Object> conf,
TopologyContext context)
The emitter for a TransactionalSpout runs as many tasks across the cluster.
|
Fields |
getOutputFields() |
TridentJmsSpout |
named(String name)
Set the name for this spout, to improve log identification.
|
TridentJmsSpout |
withJmsAcknowledgeMode(int jmsAcknowledgeMode)
Set the JMS acknowledge mode for messages being processed by this spout.
|
TridentJmsSpout |
withJmsProvider(JmsProvider provider)
Set the
JmsProvider implementation that this Spout will use to connect to a JMS
javax.jms.Desination . |
TridentJmsSpout |
withTupleProducer(JmsTupleProducer tupleProducer)
Set the
JmsTupleProducer implementation that will convert javax.jms.Message
object to backtype.storm.tuple.Values objects to be emitted. |
public static final String MAX_BATCH_SIZE_CONF
public static final int DEFAULT_BATCH_SIZE
public TridentJmsSpout()
public TridentJmsSpout named(String name)
name
- The name to be used in log messagespublic TridentJmsSpout withJmsProvider(JmsProvider provider)
JmsProvider
implementation that this Spout will use to connect to a JMS
javax.jms.Desination
.public TridentJmsSpout withTupleProducer(JmsTupleProducer tupleProducer)
JmsTupleProducer
implementation that will convert javax.jms.Message
object to backtype.storm.tuple.Values
objects to be emitted.public TridentJmsSpout withJmsAcknowledgeMode(int jmsAcknowledgeMode)
jmsAcknowledgeMode
- The chosen acknowledge modeIllegalArgumentException
- if the mode is not recognizedpublic ITridentSpout.BatchCoordinator<JmsBatch> getCoordinator(String txStateId, Map<String,Object> conf, TopologyContext context)
ITridentSpout
Two instances are requested, one on the master batch coordinator where isReady() is called, and an instance in the coordinator bolt which is used for all other operations. The two instances do not necessarily share a worker JVM.
getCoordinator
in interface ITridentSpout<JmsBatch>
txStateId
- stream idconf
- Storm config mapcontext
- topology contextpublic ITridentSpout.Emitter<JmsBatch> getEmitter(String txStateId, Map<String,Object> conf, TopologyContext context)
ITridentSpout
All emitter tasks get the same transaction metadata. The topology context parameter contains the instance task id that can be used to distribute the work across the tasks.
getEmitter
in interface ITridentSpout<JmsBatch>
txStateId
- stream idconf
- Storm config mapcontext
- topology contextpublic Map<String,Object> getComponentConfiguration()
getComponentConfiguration
in interface ITridentSpout<JmsBatch>
public Fields getOutputFields()
getOutputFields
in interface ITridentSpout<JmsBatch>
Copyright © 2023 The Apache Software Foundation. All rights reserved.