In part 1 of this blog series, we saw how –
- HCI Uses the Twitter Component of Apache Camel
- Apache Camel examples can be utilized to understand the inner workings of HCI
- sinceId will enable us to capture only new Tweets from a Twitter hanle
- twitter4j.status is the format of search results of Twitter adapter
In this blog we will now use the leanings above to update our Integration flow to enable us to Query the timeline of a twitter user for any Delta Tweets.
High Level Process
- As it is important to persist the since_Id, we will use Global Variables of HCI to retrieve and update the since_Id.
- The Keywords CamelTwitterKeywords and CamelTwitterSinceId are used to set the Search Keywords and SinceId ( Refer to camel documentation for Twitter )
- The conversion of the Java Array List twitter4j.status into XML is a custom process that uses the twitter4.status class and its various methods.
- The code is just a snippet on how to use the Twitter4j.status. Not all methods have been used and this can be modified to suit your needs.
||Configuration and Usage|
Execution of Flow
Through this use case, we had the opportunity to explore Apache Camel and get an insight into the working of Hana Cloud Integration. While this blog focuses on the Twitter example from Apache Camel, there are multiple other examples which which Apache Camel provides which are equally helpful and can help you on your journey of HCI as you start building complex integration patterns.
It is always good to understand how the underlying platform of execution works and I hope this blog inspires you to explore Apache Camel Framework and use it within HCI.