This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • Twitter Websocket Blueprint Example

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Twitter Websocket Blueprint Example

Available as of Camel 2.12

This example is located in the Camel distribution at examples/camel-example-twitter-websocket-blueprint.

The example is demonstrating how to poll a constant feed of twitter searches and publish results in real time using web socket to a web page. This example is already configured using a testing purpose twitter account named 'cameltweet'. And therefore the example is ready to run out of the box. This account is only for testing purpose, and should not be used in your custom applications. For that you need to setup and use your own twitter account.

See more details at Twitter Websocket Example about how to configure twitter to use your own account.

Running this example

This example requires running in Apache Karaf / ServiceMix

You will need to install this example first to your local maven repository with:

Code Block
  mvn install

To install Apache Camel in Karaf you type in the shell (as an example here we make use of Camel version 2.12.0):

Code Block
  features:chooseurl camel 2.12.0

First you need to install the following features in Karaf/ServiceMix with:

Code Block
  features:install camel-blueprint
  features:install camel-twitter
  features:install camel-websocket

Then you can install the Camel example:

Code Block
  osgi:install -s mvn:org.apache.camel/camel-example-twitter-websocket-blueprint/2.12.0

Then open a browser to see live twitter updates in the web page

Code Block

When the application runs, the webpage should automatic update with new tweets.

Blueprint XML file

The 'meat' of this example is defined in the OSGi Blueprint XML file in the src/main/resources/OSGI-INF/blueprint/camel-twitter.xml file, which would be a good idea to take a look at, to better understand this example.

See also