Posts tonen met het label JBoss. Alle posts tonen
Posts tonen met het label JBoss. Alle posts tonen

woensdag 21 maart 2012

Analyzing twitter using JBossESB

Most ESB example start from some HelloWorld use case, where you have to send a message to the ESB and it will print it to the console. In this post I would like to show that you can do a lot more with an ESB, for example reading and analyzing data from social media like twitter.

The example below will demonstrate how you can use JBossESB to retweet every message containing a certain hashtag. If you want you can extend the example an store all the message to database, or keep track of those users who have posted the most amount of messages with a certain content.

Prerequisites

Step 1) Create a scheduler using JBossESB
When you want to retweet all messages containing a certain hasshtag, you need some kind of scheduler that is fired every second, minute or hour. In the jboss-esb.xml file you can do this by using a 'schedule-provider'.
This cron-trigger can be used in a schedule-listener to invoke a certain action or chain of actions which is explained in the next step. The cron-expression above will be fired every hour.

Step 2) Create a listener that creates an ESB aware message
Each time the above trigger is fired, a listener should be triggered that can catch the event and process it. In this example the event processor will create a new ESB aware message and put the hashtag in it to look for.


xml-configuration

event-processor
In this case we put "Xebia" as the hashtag to look for. If you want you can configure some property file for example that contain all the hashtags to look for.

Step 3) Create an action that searches for the tweets and reposts them if needed
Next step is to create a service that contains an action that will search for all tweets containing the String that was put in the message body in step 2 and retweets those messages if they are new.


xml-configuration
action


For the configurationBuilder you will have to create the OAuth Access token yourself, by registering your application on the twitter website. 
First we query for the last tweeted message by the current user. The id of that tweet will be used in the next query to fetch only those tweets with a higher id.
For each tweet found, we retweet that by passing the original id. Notice that we only send the id, and not the whole message.

Step 4) Deploy and have fun
You can use maven to create a jar file out of it and deploy this to the JBoss AS. Once deployed this application will start retweeting all tweets containing #Xebia to your own twitter account.

Possible extensions: Of course you can add additional actions that analyze the contents of the messages.
  • Only tweeting positive messages
  • Change messages before retweeting. Example, always add #like
  • Forward tweets to other social media
  • Organize a game where you keep track of who has send the most tweets
  • Convert all tweets to email
  • Anything else you would like to do...
All code snippets can be found in this zip file


Joris De Winne recently moved from Belgium to the Netherlands, and is now working for Xebia as an IT architect, with a lot of experience in open source and Agile/Scrum consultancy.

dinsdag 20 juli 2010

JBUG.be Summer Talks

The program for our Summer Talks is complete! Here it is...

18:00 - 19:00: Quinten Laureijs - From Project to Product, Open Source powering your Enterprise

Everyone knows the path taken to create Open Source software and within Red Hat Middleware we have the various JBoss projects hosted at JBoss.org. There are often questions relating to how Red Hat is able to support Open Source for usage in the often complex Enterprise environments you are developing, deploying and managing your application in. This is done by providing Enterprise ready Products hosted at JBoss.com.

This session will outline the process involved in getting pure Open Source projects from JBoss.org into shape for Enterprise usage at JBoss.com. Furthermore, a complete overview
of all JBoss Enterprise Products will be covered including a quick look at some of the newer changes that have been taking place over the last year.

19:00 - 20:00: Steven Eggenstein & Evgueni Smoliar - Integrate the JBoss SOA platform with SAP R/3

Steven and Evgueni will give a compelling presentation about how to integrate the JBoss SOA platform with SAP R/3. Their knowledge and experience on this topic is based on a real-life project implementation in Belgium with Open Source technology.

I think we can all agree on the fact that these talks will be very interesting (to say the least).
So... do not forget to register for this event! (Maximum capacity is set to 45 people)

See you soon on the 2nd of August at Capgemini premises!




dinsdag 21 juli 2009

JBUG.be slides and pictures

The slides and pictures from the last event are online! Checkout the jbug.be site.

woensdag 17 juni 2009

JBUG.BE even 9th of July

On the 9th of July, it is time to meet on our summer talks.

We will be accompanied by two real JBoss representatives.

The first Speaker will be Joram Barrez or Tom Baeyens (whoever wins/loses the fight), which will guide us through the final release of jBPM 4.0. The newest version will be out in the wild for just one week by then, so expect some hot news coming straight from the source. It'll be a good time to finally see what made it in this release and what they have planned for us later.

Carlo de Wolf, EJB3 Lead Developer at JBoss, will give us a first-class overview of the benefits of EJB3 in his presentation "Why use Spring? Tip the scales using EJB3".

This time Capgemini is so kind to provide us with an appropriate location. They are located in Diegem, Bessenveldstraat 19, which is between Brussels and the National Airport. The event starts at 18h00 and will finish with some drinks at 20h00.

Don't miss out and register for this event today.

Looking forward to meeting you,
The JBUG.be Team

dinsdag 14 april 2009

JBUG.BE event 11th of June

JBUG.BE is looking for speakers for it's next event: an evening of lightning talks. A lightning talk is a short presentation with a hard limit of 5 minutes, followed by 5 minutes of Q&A and can be on any topic related to JBoss (http://en.wikipedia.org/wiki/Lightning_Talk).

So if you have found a workaround for a problem and you want to spread it into the community? Or you are doing something special that you are very proud of? why not explain it to everyone in a lightning talk?

If you want to make your voice heard, please send an email to info@jbug.be This e-mail address is being protected from spambots. You need JavaScript enabled to view it containing:

  • your name & contact information
  • a talk title
  • a short abstract

Additionally, if you plan to use presentation slides, include:

  • a final version of your presentation slides (average 3-4 slides) as all slides will be presented from a common laptop during Lightning Talks

Closing date for submissions is the 22nd of May.

A maximum of 10 speakers will be added to the agenda. Every potential presenter will receive a notification on the 24th of May whether (s)he is selected or not.

The event will take place the 11th of June 2009 from 7 - 9 PM (location to be defined).

The JBUG.be team

zondag 8 februari 2009

Benelux JBoss User Group, 27 February 2009

Information Taken from Lunatech website:

----

We would like to invite you to our fifth Benelux JBoss User Group meeting: an evening of free technical sessions presented by JBoss and RealDolmen developers.

We will meet in Rotterdam. The exact location will be communicated later, so stay tuned.

* Date: Friday, 27 February 2009
* Time: Arrival 1600-1630, presentations start 1630, finish 1900-1930
* Location: T.B.A / Rotterdam

Programme

The programme will begin with a complete presentation of JBoss Seam by Joris de Winne and Jeroen Verhulst from RealDolmen. The talk will explain the basic concepts of JBoss Seam covering how to create components, injection, outjection, scope levels, security… In addition, it will give an overview of the pros and cons of the technology illustrated by a practical example. Special attention will be paid to how to test a JBoss Seam application.

In the second presentation, Mark Proctor, lead for JBoss Drools, will talk about Rules, Workflow and Event Processing (often referred to as event stream processing or complex event processing) are at the heart of the Business Logic for most enterprises. Each one provides a declarative environment to model business problems, but is limited in the scope and range of problems it can define. Typically an enterprise will source each product from a different vendor and at some level tries to integrate the three. This integration is often very limited and superficial, such as processes only using rules for stateless decision services. This session presents the Business Logic integration Platform (BLiP) concept which offers an integrated and unified approach.

Of course, beer and networking are also part of the programme ;)

Please register as soon as possible as we have a limited number of seats.