In this assignment your PR must only modify the README.md
file.
Please, go to the Wiki in order to get the instructions for this assignment.
Camel is an Open Source integration framework that empowers you to quickly and easily integrate various systems consuming or producing data. This is a common SOA scenario. The snippet below:
- Search tweets in Twitter and returns to the web client
- Dump to disk at least one of tweets retrieved encoded in JSON in the folder
log/{year}/{month}/{day}
- Compute metrics (available at
/actuator/metrics/per-keyword-messages?tag=keyword:${value}
, values available athttp://localhost:8080/actuator/metrics/per-keyword-messages
)
from(DIRECT_ROUTE)
.toD("twitter-search:\${header.keywords}") // Twitter search, returns a list of Tweets
.wireTap(LOG_ROUTE) // Copy the list of tweets to the LOG_ROUTE, which is processed by its own thread
.wireTap(COUNT_ROUTE) // Copy the list of tweets to the COUNT_ROUTE, which is processed by its own thread
// returns a list of tweets to the DIRECT_ROUTE caller
from(LOG_ROUTE)
.marshal().json(JsonLibrary.Gson) // Encode the list of tweets as JSON
.to("file://log?fileName=\${date:now:yyyy/MM/dd/HH-mm-ss.SSS}.json") // Write the JSON to a file
from(COUNT_ROUTE)
.split(body()) // Split the list in single Tweets
.process { exchange -> // Process a single Tweet
val keyword = exchange.getIn().getHeader("keywords")
if (keyword is String) {
keyword.split(" ").map {
perKeywordMessages.increment(it)
}
}
}
The objective is to extend the query interface to support the command max:n
, where n is a number.
max
sets a limit in the number of retrieved tweets.
That is cool max:10
must return at most 10 tweets.
There are several ways to do it.
You can use the parameter q
or create additional parameters.
There is a restriction.
You must explicitly tell the API Twitter to enforce such a limit.
Read the documentation of the Twitter Search component of Apache Camel to discover how.
You need to apply for a free Twitter developer account.
Do not add application.properties
with the Twitter tokens to your git!
Note: the Twitter Search endpoint is configured using URI syntax twitter-search:{string}[?param=value[¶m=value]*]
Proposed:
- Use Camel for providing a WebSocket endpoint for queries; a websocket client is required.
- Use Camel for keeping a copy of responses in a database
- Enrich the response with moustache; remove moustache from the client.
- Create an operator "-" to filter out tweets that contain a keyword
The link provides one of the possible approaches. You can use a different one.
The possibilities of Camel are endless; you can propose your idea for a 🎁.
Manifest your intention first by a PR updating this README.md
with your goal.
If you desist of your goal, release it by a PR so other fellow can try it.
User name | NIA | Status | Improvement | Score |
---|---|---|---|---|
UNIZAR-30246-WebEngineering | 30246 | instructions | ||
Diego Marco | 755232 | Solution | ||
Alejandro Magallón | 779354 | Solution | ||
Óscar Pueyo | 780378 | Solution | ||
María Peña | 780448 | Solution | ||
Tomás Pelayo | 779691 | Solution | ||
Jorge Laguna | 735550 | Throttle the route to avoid be banned by Twitter | 🎁 | |
María Peña | 780448 | Solution | ||
Andoni Salcedo | 785649 | Solution | ||
Alejandro Artal | 775929 | Solution | ||
Jaime Conchello | 776012 | Solution | ||
Fernando Serrano | 774840 | Solution | Rest EndPoint 🎁 | |
José Marín | 778148 | Solution | ||
Mateo Vallejo | 780029 | Solution | ||
Diego García Muro | 767870 | Solution | ||
Pablo Jordán | 757166 | Solution | ||
Sergio Benítez Mombiela | 755787 | Solution | ||
Isaac Velasco | 758986 | Solution | ||
Héctor Bara | 779354 | Solution | ||
Rubén Subías | 759406 | Solution | ||
Germán Garcés | 757024 | Solution | ||
Alvaro Echavarri | 737400 | Solution | ||
Marta Morales Sabroso | 780454 | Solution | ||
Binhui Chen Zhou | 779799 | Solution | ||
Jorge Serrano | 776453 | Solution | ||
Guillermo Cánovas | 755848 | Solution |