Files
spring-integration-samples/dsl/si4demo
2014-06-19 16:18:23 +03:00
..
2014-06-19 16:18:23 +03:00
2014-05-28 12:58:25 -04:00

#Spring Integration 4.0 Java Config/DSL Demo

This sample is the demo used in the Spring Integration 4.0 Webinar

It's currently using the spring-boot 1.1.0.M1 milestone so you may have to add the repo.spring.io/repo repository to your settings.xml.

There are two demo applications:

org.springframework.integration.samples.javaconfig.annotations.Application is a Spring Boot application using Spring Integration 4.0 Java configuration features.

org.springframework.integration.samples.javaconfig.dsl.Application is the equivalent application using the new Java DSL that is currently being developed in the extensions github repository

In both cases, you can use Telnet or curl to search twitter

$ telnet localhost 9876
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
#springintegration
[{"extraData":{},"id":461548132401438720,"text":"RT @gprussell: Spring Integration 4.0.0.RELEASE is out! ...

$ curl http://localhost:8080/foo -H"content-type:text/plain" -d '#springintegration'
[{"extraData":{},"id":461548132401438720,"text":"RT @gprussell: Spring Integration 4.0.0.RELEASE is out! ...

The DSL version also accepts typing in a hashtag for the search in the console. The DSL version also adds a filter to only allow hashtags starting with #spring, and only returns the first tweet.

Twitter now requires authentication to perform searches; visit the twitter developer site to set up the application and enter the keys/secrets in application.yml on the classpath. An 'empty' yaml file is provided in _src/main/resources:

twitter:
  oauth:
    consumerKey:
    consumerSecret:
    accessToken:
    accessTokenSecret: