Package org.apache.nifi.jms.processors
Class AbstractJMSProcessor<T extends JMSWorker>
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.jms.processors.AbstractJMSProcessor<T>
- Type Parameters:
T- the type ofJMSWorkerwhich could beJMSPublisherorJMSConsumer
- All Implemented Interfaces:
ConfigurableComponent,Processor
- Direct Known Subclasses:
ConsumeJMS,PublishJMS
Base JMS processor to support implementation of JMS producers and consumers.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final PropertyDescriptor(package private) static final PropertyDescriptor(package private) static final String(package private) static final PropertyDescriptor(package private) static final PropertyDescriptor(package private) static final PropertyDescriptorprivate final AtomicIntegerprivate IJMSConnectionFactoryProvider(package private) static final PropertyDescriptor(package private) static final PropertyDescriptor(package private) static final List<PropertyDescriptor> (package private) static final List<PropertyDescriptor> (package private) static final PropertyDescriptor(package private) static final String(package private) static final String(package private) static final String(package private) static final PropertyDescriptorprivate BlockingQueue<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate TbuildTargetResource(ProcessContext context) This method essentially performs initialization of this Processor by obtaining an instance of theConnectionFactoryfrom theJMSConnectionFactoryProvider(ControllerService) and performing a series ofConnectionFactoryadaptations which eventually results in an instance of theCachingConnectionFactoryused to constructJmsTemplateused by this Processor.voidclose()protected Collection<ValidationResult> customValidate(ValidationContext validationContext) protected abstract TfinishBuildingJmsWorker(org.springframework.jms.connection.CachingConnectionFactory connectionFactory, org.springframework.jms.core.JmsTemplate jmsTemplate, ProcessContext processContext) Finishes building one of theJMSWorkersubclasses T.protected static StringgetClientId(ProcessContext context) protected PropertyDescriptorgetSupportedDynamicPropertyDescriptor(String propertyDescriptorName) voidvoidonTrigger(ProcessContext context, ProcessSession session) protected abstract voidrendezvousWithJms(ProcessContext context, ProcessSession session, T jmsWorker) Delegate method to supplementonTrigger(ProcessContext, ProcessSession)operation.protected voidsetClientId(ProcessContext context, org.springframework.jms.connection.SingleConnectionFactory connectionFactory) Set clientId for JMS connections when clientId is not null.voidvoidsetupWorkerPool(ProcessContext context) voidMethods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getRelationships, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedPropertyDescriptors, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateRelationships
-
Field Details
-
QUEUE
- See Also:
-
TOPIC
- See Also:
-
TEXT_MESSAGE
- See Also:
-
BYTES_MESSAGE
- See Also:
-
USER
-
PASSWORD
-
DESTINATION
-
DESTINATION_TYPE
-
CLIENT_ID
-
CHARSET
-
CF_SERVICE
-
JNDI_JMS_CF_PROPERTIES
-
JMS_CF_PROPERTIES
-
BASE_RECORD_READER
-
BASE_RECORD_WRITER
-
connectionFactoryProvider
-
workerPool
-
clientIdCounter
-
-
Constructor Details
-
AbstractJMSProcessor
public AbstractJMSProcessor()
-
-
Method Details
-
getClientId
-
getSupportedDynamicPropertyDescriptor
- Overrides:
getSupportedDynamicPropertyDescriptorin classAbstractConfigurableComponent
-
migrateProperties
-
customValidate
- Overrides:
customValidatein classAbstractConfigurableComponent
-
onTrigger
- Specified by:
onTriggerin classAbstractProcessor- Throws:
ProcessException
-
setupConnectionFactoryProvider
-
shutdownConnectionFactoryProvider
-
setupWorkerPool
-
close
-
rendezvousWithJms
protected abstract void rendezvousWithJms(ProcessContext context, ProcessSession session, T jmsWorker) throws ProcessException Delegate method to supplementonTrigger(ProcessContext, ProcessSession)operation. It is implemented by sub-classes to performProcessorspecific functionality.- Throws:
ProcessException
-
finishBuildingJmsWorker
protected abstract T finishBuildingJmsWorker(org.springframework.jms.connection.CachingConnectionFactory connectionFactory, org.springframework.jms.core.JmsTemplate jmsTemplate, ProcessContext processContext) Finishes building one of theJMSWorkersubclasses T.- See Also:
-
buildTargetResource
This method essentially performs initialization of this Processor by obtaining an instance of theConnectionFactoryfrom theJMSConnectionFactoryProvider(ControllerService) and performing a series ofConnectionFactoryadaptations which eventually results in an instance of theCachingConnectionFactoryused to constructJmsTemplateused by this Processor. -
setClientId
protected void setClientId(ProcessContext context, org.springframework.jms.connection.SingleConnectionFactory connectionFactory) Set clientId for JMS connections when clientId is not null. It is overridden by ConsumeJMS when durable subscriptions is configured on the processor.- Parameters:
context- context.connectionFactory- the connection factory.- Since:
- NIFI-6915
-