<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:int="http://www.springframework.org/schema/integration"
	xmlns:int-mqtt="http://www.springframework.org/schema/integration/mqtt"
	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
		http://www.springframework.org/schema/integration/mqtt https://www.springframework.org/schema/integration/mqtt/spring-integration-mqtt.xsd">

	<int:channel id="target"/>

	<int-mqtt:outbound-channel-adapter id="withConverter"
									   client-id="foo"
									   url="tcp://localhost:1883"
									   auto-startup="false"
									   converter="myConverter"
									   client-factory="clientFactory"
									   default-topic="bar"
									   topic-expression="'bar'"
									   qos-expression="2"
									   retained-expression="true"
									   phase="25"
									   order="1"
									   channel="target">
		<int-mqtt:request-handler-advice-chain>
			<int:retry-advice/>
		</int-mqtt:request-handler-advice-chain>
	</int-mqtt:outbound-channel-adapter>

	<int-mqtt:outbound-channel-adapter id="withDefaultConverter"
			client-id="foo"
			url="tcp://localhost:1883"
			auto-startup="false"
			default-qos="1"
			default-retained="true"
			default-topic="bar"
			client-factory="clientFactory"
			phase="25"
			order="1"
			async="true"
			async-events="true"
			channel="target" />

	<bean id="myConverter" class="org.springframework.integration.mqtt.support.DefaultPahoMessageConverter" />

	<bean id="clientFactory" class="org.springframework.integration.mqtt.core.DefaultMqttPahoClientFactory" />
</beans>
