|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | 2 | <beans xmlns="http://www.springframework.org/schema/beans" |
3 | | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
4 | | - xmlns:int="http://www.springframework.org/schema/integration" |
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration" |
5 | 4 | xmlns:file="http://www.springframework.org/schema/integration/file" |
6 | 5 | xmlns:ftp="http://www.springframework.org/schema/integration/ftp" |
7 | 6 | xmlns:mail="http://www.springframework.org/schema/integration/mail" |
|
14 | 13 | http://www.springframework.org/schema/integration/file/spring-integration-file.xsd |
15 | 14 | http://www.springframework.org/schema/integration/ftp |
16 | 15 | http://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd |
17 | | - http://www.springframework.org/schema/integration/mail |
| 16 | + http://www.springframework.org/schema/integration/mail |
18 | 17 | http://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd |
19 | | - http://www.springframework.org/schema/integration/twitter |
| 18 | + http://www.springframework.org/schema/integration/twitter |
20 | 19 | http://www.springframework.org/schema/integration/twitter/spring-integration-twitter.xsd"> |
21 | 20 |
|
| 21 | + <int:publish-subscribe-channel id="videoChannel" /> |
| 22 | + |
| 23 | + <int:bridge input-channel="videoChannel" output-channel="ftpOutbound" /> |
| 24 | + <int:channel id="ftpOutbound" /> |
| 25 | + <int:bridge input-channel="videoChannel" output-channel="emailOutbound" /> |
| 26 | + <int:channel id="emailOutbound" /> |
| 27 | + |
| 28 | + |
| 29 | + <int:bridge output-channel="twitterOutbound" input-channel="videoChannel" /> |
| 30 | + |
| 31 | + <int:channel id="twitterOutbound" /> |
| 32 | + |
| 33 | + <twitter:outbound-channel-adapter |
| 34 | + twitter-template="twitterTemplate" channel="twitterOutbound" /> |
| 35 | + |
| 36 | + <bean name="twitterTemplate" |
| 37 | + class="org.springframework.social.twitter.api.impl.TwitterTemplate"> |
| 38 | + <constructor-arg index="0" value="${consumer-key}" /> |
| 39 | + <constructor-arg index="1" value="${consumer-secret}" /> |
| 40 | + <constructor-arg index="2" value="${access-token}" /> |
| 41 | + <constructor-arg index="3" value="${access-token-secret}" /> |
| 42 | + </bean> |
| 43 | + |
22 | 44 | <file:inbound-channel-adapter id="videoFolder" |
23 | | - directory="C:\projects\baeldung\clean-start-tutorials\tutorials\spring-integration\src\main\resources\source" |
24 | | - channel="videoChannel" |
| 45 | + directory="/studio/edits/video" channel="videoChannel" |
25 | 46 | prevent-duplicates="true"> |
26 | | - <int:poller fixed-rate="1000"/> |
| 47 | + <int:poller fixed-rate="1000" /> |
27 | 48 | </file:inbound-channel-adapter> |
28 | 49 |
|
29 | | - <file:outbound-channel-adapter id="destFileFolder" |
30 | | - directory="C:\projects\baeldung\clean-start-tutorials\tutorials\spring-integration\src\main\resources\destination" |
31 | | - channel="videoChannel" |
32 | | - > |
33 | | - </file:outbound-channel-adapter> |
| 50 | + <mail:outbound-channel-adapter channel="emailOutbound" |
| 51 | + mail-sender="mailSender" /> |
| 52 | + |
| 53 | + <bean name="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"> |
| 54 | + <property name="host" value="smtp.gmail.com" /> |
| 55 | + <property name="port" value="587" /> |
| 56 | + <property name="username" value="yourUsername" /> |
| 57 | + <property name="password" value="yourPassword" /> |
| 58 | + </bean> |
| 59 | + |
| 60 | + <ftp:outbound-channel-adapter channel="ftpOutbound" |
| 61 | + remote-directory="/news/archive/video/" session-factory="sessionFactory" /> |
| 62 | + |
| 63 | + |
34 | 64 |
|
35 | | - <int:channel id="videoChannel"/> |
| 65 | + <bean name="sessionFactory" |
| 66 | + class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory"> |
| 67 | + <property name="host" value="localhost" /> |
| 68 | + <property name="port" value="587" /> |
| 69 | + <property name="username" value="yourUsername" /> |
| 70 | + <property name="password" value="yourPassword" /> |
| 71 | + </bean> |
36 | 72 |
|
37 | | - <!-- <int:service-activator input-channel="videoChannel" output-channel="destFileFolder" method="handleMessage" |
38 | | - ref="customActivator"/> |
| 73 | + <int:bridge input-channel="videoChannel" output-channel="activatorChannel"/> |
| 74 | + <int:channel id="activatorChannel"/> |
39 | 75 |
|
40 | | - <bean name="customActivator" class="com.baeldung.samples.endpoints.ActivatorImpl"/>--> |
| 76 | + <int:service-activator input-channel="activatorChannel" method="handleMessage" ref="customActivator"/> |
41 | 77 |
|
| 78 | + <bean name="customActivator" class="com.baeldung.samples.endpoints.ActivatorImpl"/> |
42 | 79 |
|
43 | 80 | </beans> |
0 commit comments