Class JdbcListener
- All Implemented Interfaces:
FrankElement, HasApplicationContext, HasName, HasPhysicalDestination, IConfigurable, IHasProcessState<Serializable>, IListener<Serializable>, IPeekableListener<Serializable>, IPullingListener<Serializable>, IRedeliveringListener<Serializable>, IScopeProvider, NameAware, TransactionAware, ConfigurableLifecycle, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle
- Direct Known Subclasses:
JdbcQueryListener, JdbcTableListener
- Since:
- 4.7
- Author:
- Gerrit van Brakel
-
Field Summary
Fields inherited from class AbstractJdbcListener
ADDITIONAL_QUERY_FIELDS_KEY, additionalFields, additionalFieldsList, correlationIdField, keyField, messageField, messageIdField, peekQuery, peekUntransacted, preparedPeekQuery, preparedSelectQuery, selectQuery, traceFields inherited from class JdbcFacade
logFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterMessageProcessed(PipeLineResult processResult, RawMessageWrapper<Serializable> rawMessage, PipeLineSession pipeLineSession) Called to perform actions (like committing or sending a reply) after a message has been processed by the Pipeline.protected @Nullable RawMessageWrapper<Serializable> changeProcessState(Connection connection, RawMessageWrapper<Serializable> rawMessage, ProcessState toState, String reason) @Nullable RawMessageWrapper<Serializable> changeProcessState(RawMessageWrapper<Serializable> rawMessage, ProcessState toState, String reason) Change the processState of the message to the specified state, if that state is supported.voidConfigure this component.protected @NonNull StringgetKeyFromRawMessage(RawMessageWrapper<Serializable> rawMessage) Get the storage-key for the Message from theRawMessageWrapper.protected @Nullable RawMessageWrapper<Serializable> getRawMessage(Connection conn, Map<String, Object> threadContext) @Nullable RawMessageWrapper<Serializable> getRawMessage(@NonNull Map<String, Object> threadContext) Retrieves messages from queue or other channel, but does no processing on it.getUpdateStatusQuery(ProcessState state) Provides the set of ProcessStates used by this listener.booleanvoidsetMessageFieldType(@NonNull String ignored) Deprecated, for removal: This API element is subject to removal in a future version.No longer needed, automatically determinedprotected voidsetUpdateStatusQuery(ProcessState state, String query) Provides the set of ProcessStates that a message in the specified state can be moved to, e.g. from a MessageBrowser for that state.Methods inherited from class AbstractJdbcListener
addAdditionalValuesToMessageWrapper, closeThread, execute, extractMessage, extractRawMessage, getColumnValueOrDefault, getMessageKeyOrNull, hasRawMessageAvailable, openThread, setAdditionalFields, setCorrelationIdField, setKeyField, setMessageField, setMessageIdField, setPeekQuery, setPeekUntransacted, setSelectQueryMethods inherited from class JdbcFacade
convertQuery, getConnection, getConnectionWithTimeout, getDatasource, getDatasourceName, getDbmsSupport, getLogPrefix, getPassword, getPhysicalDestinationName, isRunning, setAuthAlias, setBlobCharset, setBlobsCompressed, setBlobSmartGet, setDatasourceName, setDbmsSupportFactory, setName, setPassword, setSqlDialect, setUsername, start, stop, withConnection, withConnectionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface ConfigurableLifecycle
getPhase, isAutoStartup, isConfiguredMethods inherited from interface FrankElement
addConfigWarningMethods inherited from interface HasApplicationContext
getApplicationContext, getConfigurationClassLoaderMethods inherited from interface IListener
extractMessage, start, stopMethods inherited from interface IPeekableListener
hasRawMessageAvailable, isPeekUntransacted, setPeekUntransactedMethods inherited from interface IPullingListener
closeThread, openThreadMethods inherited from interface org.springframework.context.SmartLifecycle
isPauseable, stop
-
Constructor Details
-
JdbcListener
public JdbcListener()
-
-
Method Details
-
configure
Description copied from interface:IConfigurableConfigure this component.configure()is called once at startup of the framework in the configure method of the owner of thisIConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in theconfigure(), to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configurein interfaceIConfigurable- Overrides:
configurein classAbstractJdbcListener- Throws:
ConfigurationException- in case it was not able to configure the component.
-
messageWillBeRedeliveredOnExitStateError
public boolean messageWillBeRedeliveredOnExitStateError()- Specified by:
messageWillBeRedeliveredOnExitStateErrorin interfaceIRedeliveringListener<Serializable>
-
getRawMessage
public @Nullable RawMessageWrapper<Serializable> getRawMessage(@NonNull Map<String, Object> threadContext) throws ListenerExceptionDescription copied from interface:IPullingListenerRetrieves messages from queue or other channel, but does no processing on it. Multiple objects may try to call this method at the same time, from different threads. Implementations of this method should therefore be thread-safe, orsynchronized.Any thread-specific properties should be stored in and retrieved from the threadContext.
If the returned object is an instance of
.MessageWrapperthen thewill not callinvalid reference
org.frankframework.receivers.Receiver#processRawMessage(IListener, RawMessageWrapper, PipeLineSession, boolean)IListener.extractMessage(RawMessageWrapper, Map)but directly access the enclosedMessageand theinvalid reference
RawMessageWrapper#getContext()- Specified by:
getRawMessagein interfaceIPullingListener<Serializable>- Throws:
ListenerException
-
getRawMessage
protected @Nullable RawMessageWrapper<Serializable> getRawMessage(Connection conn, Map<String, Object> threadContext) throws ListenerException- Throws:
ListenerException
-
getKeyFromRawMessage
Get the storage-key for the Message from theRawMessageWrapper. Throw an exception if not found, key-field is mandatory for state-changing listeners. -
afterMessageProcessed
public void afterMessageProcessed(PipeLineResult processResult, RawMessageWrapper<Serializable> rawMessage, PipeLineSession pipeLineSession) Description copied from interface:IListenerCalled to perform actions (like committing or sending a reply) after a message has been processed by the Pipeline.- Specified by:
afterMessageProcessedin interfaceIListener<Serializable>
-
knownProcessStates
Description copied from interface:IHasProcessStateProvides the set of ProcessStates used by this listener.- Specified by:
knownProcessStatesin interfaceIHasProcessState<Serializable>
-
targetProcessStates
Description copied from interface:IHasProcessStateProvides the set of ProcessStates that a message in the specified state can be moved to, e.g. from a MessageBrowser for that state.- Specified by:
targetProcessStatesin interfaceIHasProcessState<Serializable>
-
changeProcessState
public @Nullable RawMessageWrapper<Serializable> changeProcessState(RawMessageWrapper<Serializable> rawMessage, ProcessState toState, String reason) throws ListenerException Description copied from interface:IHasProcessStateChange the processState of the message to the specified state, if that state is supported. If it is not supported, nothing changes, andfalseis returned.- Specified by:
changeProcessStatein interfaceIHasProcessState<Serializable>- Returns:
- the moved message, or null if no message was moved.
- Throws:
ListenerException
-
changeProcessState
protected @Nullable RawMessageWrapper<Serializable> changeProcessState(Connection connection, RawMessageWrapper<Serializable> rawMessage, ProcessState toState, String reason) throws ListenerException - Throws:
ListenerException
-
setUpdateStatusQuery
-
getUpdateStatusQuery
-
setMessageFieldType
@Deprecated(forRemoval=true, since="10.4") @ConfigurationWarning("It is no longer necessary to configure this") public void setMessageFieldType(@NonNull String ignored) Deprecated, for removal: This API element is subject to removal in a future version.No longer needed, automatically determinedType of the field containing the message data - no longer needed as the listener will now automatically determine the message field type
-