Files
spring-integration-samples/basic/twitter
Artem Bilan 5f524dc534 Upgrade to SI-5.0 & SIK-3.0, Reactor 3.0
* Fix compatibility after Java DSL migration to the SI Core
* Also upgrade all the JMS sample to the JMS 2.0
* Fix default `connectionFactory` bean reference to the current `jmsConnectionFactory`
* Remove unsupported JPA-1.0 Spec via `OpenJpaAutoConfiguration`, since the minimum now is JPA-2.0
* Remove non-lambda sample since minimum now is Java 8
* Rename `PromiseTest` to `MonoTest` and fix it to Reactor 3.0
* Fix `stomp-server.xml` to use proper Reactor 3.0 `eactor.util.function.Tuples` for SpEL
* Regenerate POMs
2016-11-18 14:11:32 -05:00
..
2014-04-16 20:45:34 +03:00

Twitter Sample

This example demonstrates the following aspects of the Twitter support available with Spring Integration:

  1. Twitter Inbound Channel Adapter - allows you to receive HOME status updates
  2. Twitter Inbound Search Channel Adapter - allows you to receive HOME status updates
  3. Twitter Outbound Channel Adapter - allows send status updates

In order to run this sample you need to configure OAuth and set the values in the OAuth properties.

To use OAuth authentication/authorization with Twitter you must create a new Application on the Twitter Developers site. Follow the directions below to create a new application and obtain the consumer keys and the access token:

  • Go to http://dev.twitter.com/
  • Log in to your account
  • Go to My applications.
  • Click on 'Create a new application' link and fill out all required fields on the form provided;
  • Submit the form.
  • If everything is successful you'll be presented with the 'Consumer Key' and 'Consumer Secret'.
  • Copy both values to a safe place.
  • On the same page you should see 'My Access Token' button on bottom of the page.
  • Click on it and you'll be presented with two more values: 'Access Token' and 'Access Token Secret'.
  • Copy these values to a safe place as well.

When done, fill out oauth.properties file so it looks similar to this.

twitter.oauth.consumerKey=4XzBPabcJQxyBzzzH3TrRQ
twitter.oauth.consumerSecret=ab2piKdMfPu8bVa3ab6DAIvIWEVZyMDL0RSEN2I8
twitter.oauth.accessToken=21691649-4XYZY5iJEOfz2A9qCFd9SjBRGb3HLmIm4HNE6AMv4
twitter.oauth.accessTokenSecret=AbRxUAvyNCtqQtvxFK8w5ZMtMj20KFhB6oEfTA0

NOTE: the above values are not real ;)

Now you are ready to execute the samples. Just run each sample and look for the output produced by the inbound adapters (TwitterSearchSample.java and TwitterTimelineUpdateSample.java) The outbound adapter sample (TwitterSendUpdatesSample.java) will not produce any output. Instead within seconds you should see your tweet.