Details
-
Sub-task
-
Status: Closed
-
Minor
-
Resolution: Complete
-
4.1.1
-
None
-
None
Description
It's somewhat cumbersome to know when a certain number of messages flow down a channel (for example to print out some info to a log file after a certain # of msgs have been received).
Currently you could do something like this:
<si:publish-subscribe-channel id="seconds"> <si:interceptors> <si:wire-tap channel="thresholdLogger" selector="selector" /> </si:interceptors> </si:publish-subscribe-channel> <bean id="selector" class="org.springframework.integration.filter.ExpressionEvaluatingSelector"> <constructor-arg value="@mbeanServer.getAttribute('org.springframework.integration:type=MessageChannel,name=seconds', 'SendCount') > 5" /> </bean> <si:logging-channel-adapter id="thresholdLogger" />
It would be nice if the stats were maintained in the channel itself instead of the MBean so we could just use something like this: @channelName.sendCount > 5.