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

	<context:property-placeholder
			location="classpath:twitter.sender.properties"
			ignore-unresolvable="true"/>

	<beans:bean id="twitterTemplate" class="org.springframework.social.twitter.api.impl.TwitterTemplate">
		<beans:constructor-arg value="${twitter.oauth.consumerKey}"/>
		<beans:constructor-arg value="${twitter.oauth.consumerSecret}"/>
		<beans:constructor-arg value="${twitter.oauth.accessToken}"/>
		<beans:constructor-arg value="${twitter.oauth.accessTokenSecret}"/>
	</beans:bean>


	<channel id="inputChannel"/>

	<twitter:dm-outbound-channel-adapter twitter-template="twitterTemplate" channel="inputChannel"/>

	<chain input-channel="dmOutboundWithinChain">
		<twitter:dm-outbound-channel-adapter twitter-template="twitterTemplate"/>
	</chain>

</beans:beans>


