<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
			 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
			 xmlns="http://www.springframework.org/schema/integration"
			 xsi:schemaLocation="http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
	<message-history/>

	<channel id="channel"/>

	<channel id="wiretap-single">
		<queue/>
	</channel>

	<channel id="wiretap-all">
		<queue/>
	</channel>

	<channel id="wiretap-all2">
		<queue/>
	</channel>

	<channel id="output">
		<queue/>
	</channel>

	<channel id="random-channel"/>

	<bridge input-channel="channel" output-channel="output"/>

	<bridge input-channel="random-channel" output-channel="output"/>

	<!-- This wiretap targets a single channel -->
	<wire-tap id="wiretap-single-channel" channel="wiretap-single" pattern="channel" order="0"/>


	<!-- This second global wire-tap caused an issue previously when the second GlobalChannelInterceptorWrapper
	was registered in the application context and the message was send twice to the same (last) channel.
	In other words two GlobalChannelInterceptorWrappers were defined for the same (last) WireTap.
	According to the Spring logic the second bean definition should win. -->
	<wire-tap id="wiretap-all-channels" channel="wiretap-all2"/>

	<!-- This wiretap targets all channels -->
	<wire-tap id="wiretap-all-channels" channel="wiretap-all"/>

	<publish-subscribe-channel id="unnamedGlobalWireTaps"/>

	<wire-tap channel="unnamedGlobalWireTaps" pattern="channel"/>

	<wire-tap channel="unnamedGlobalWireTaps" pattern="channel"/>

</beans:beans>
