Class NullChannel
java.lang.Object
org.springframework.integration.channel.NullChannel
- All Implemented Interfaces:
Aware, BeanNameAware, DisposableBean, IntegrationPattern, NamedComponent, IntegrationManagement, MessageChannel, PollableChannel
@IntegrationManagedResource
public class NullChannel
extends Object
implements PollableChannel, BeanNameAware, IntegrationManagement, IntegrationPattern
A channel implementation that essentially behaves like "/dev/null".
All
receive() calls will return null,
and all send(Message, long) calls will return true although no action is performed.
Unless the payload of a sent message is a Publisher implementation, in
which case the Publisher.subscribe(Subscriber) is called to initiate
the reactive stream, although the data is discarded by this channel.
An error thrown from a reactive stream processing (see Subscriber.onError(Throwable))
is logged under the warn level.
Note however that the invocations are logged at debug-level.- Author:
- Mark Fisher, Gary Russell, Artem Bilan
-
Nested Class Summary
Nested classes/interfaces inherited from interface IntegrationManagement
IntegrationManagement.ManagementOverrides -
Field Summary
Fields inherited from interface IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface MessageChannel
INDEFINITE_TIMEOUT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Return a pattern type this component implements.Return the overrides.booleanReturn whether logging is enabled.@Nullable Message<?> receive()@Nullable Message<?> receive(long timeout) voidregisterMetricsCaptor(MetricsCaptor registry) Inject aMetricsCaptor.booleanbooleanvoidsetBeanName(String beanName) voidsetLoggingEnabled(boolean loggingEnabled) Enable logging or not.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface IntegrationManagement
getManagedName, getManagedType, getThisAs, isObserved, registerObservationRegistry, setManagedName, setManagedTypeMethods inherited from interface NamedComponent
getBeanName
-
Constructor Details
-
NullChannel
public NullChannel()
-
-
Method Details
-
setBeanName
- Specified by:
setBeanNamein interfaceBeanNameAware
-
isLoggingEnabled
public boolean isLoggingEnabled()Description copied from interface:IntegrationManagementReturn whether logging is enabled.- Specified by:
isLoggingEnabledin interfaceIntegrationManagement- Returns:
- true if enabled.
-
setLoggingEnabled
public void setLoggingEnabled(boolean loggingEnabled) Description copied from interface:IntegrationManagementEnable logging or not.- Specified by:
setLoggingEnabledin interfaceIntegrationManagement- Parameters:
loggingEnabled- false to disable.
-
getComponentName
- Specified by:
getComponentNamein interfaceNamedComponent
-
getComponentType
- Specified by:
getComponentTypein interfaceNamedComponent
-
getIntegrationPatternType
Description copied from interface:IntegrationPatternReturn a pattern type this component implements.- Specified by:
getIntegrationPatternTypein interfaceIntegrationPattern- Returns:
- the
IntegrationPatternTypethis component implements.
-
registerMetricsCaptor
Description copied from interface:IntegrationManagementInject aMetricsCaptor. Ignored ifObservationRegistryis provided.- Specified by:
registerMetricsCaptorin interfaceIntegrationManagement- Parameters:
registry- the captor.- See Also:
-
getOverrides
Description copied from interface:IntegrationManagementReturn the overrides.- Specified by:
getOverridesin interfaceIntegrationManagement- Returns:
- the overrides.
-
send
- Specified by:
sendin interfaceMessageChannel
-
send
- Specified by:
sendin interfaceMessageChannel
-
receive
- Specified by:
receivein interfacePollableChannel
-
receive
- Specified by:
receivein interfacePollableChannel
-
toString
-
destroy
public void destroy()- Specified by:
destroyin interfaceDisposableBean- Specified by:
destroyin interfaceIntegrationManagement
-