Class NullChannel
java.lang.Object
org.springframework.integration.channel.NullChannel
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,IntegrationPattern,NamedComponent,IntegrationManagement,org.springframework.messaging.MessageChannel,org.springframework.messaging.PollableChannel
@IntegrationManagedResource
public class NullChannel
extends Object
implements org.springframework.messaging.PollableChannel, org.springframework.beans.factory.BeanNameAware, IntegrationManagement, IntegrationPattern
A channel implementation that essentially behaves like "/dev/null".
All
receive() calls will return null,
and all send(org.springframework.messaging.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.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides -
Field Summary
Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.messaging.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.org.springframework.messaging.Message<?>receive()org.springframework.messaging.Message<?>receive(long timeout) voidregisterMetricsCaptor(MetricsCaptor registry) Inject aMetricsCaptor.booleansend(org.springframework.messaging.Message<?> message) booleansend(org.springframework.messaging.Message<?> message, long timeout) voidsetBeanName(String beanName) voidsetLoggingEnabled(boolean loggingEnabled) Enable logging or not.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getManagedName, getManagedType, getThisAs, registerObservationRegistry, setManagedName, setManagedType
-
Constructor Details
-
NullChannel
public NullChannel()
-
-
Method Details
-
setBeanName
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-
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.
-
getBeanName
- Specified by:
getBeanNamein interfaceNamedComponent
-
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
public boolean send(org.springframework.messaging.Message<?> message, long timeout) - Specified by:
sendin interfaceorg.springframework.messaging.MessageChannel
-
send
public boolean send(org.springframework.messaging.Message<?> message) - Specified by:
sendin interfaceorg.springframework.messaging.MessageChannel
-
receive
public org.springframework.messaging.Message<?> receive()- Specified by:
receivein interfaceorg.springframework.messaging.PollableChannel
-
receive
public org.springframework.messaging.Message<?> receive(long timeout) - Specified by:
receivein interfaceorg.springframework.messaging.PollableChannel
-
toString
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Specified by:
destroyin interfaceIntegrationManagement
-