WeatherEventMashup est une application de mashup qui combine trois sources de données :
- Météo (OpenWeatherMap API)
- Événements culturels (Ticketmaster API)
- Recommandations personnalisées (service interne)
L'application démontre les concepts avancés de middleware pour les systèmes distribués :
- Appels parallèles avec
CompletableFuture.allOf() - Cache distribué avec Redis
- Circuit Breaker avec Resilience4j
- Génération automatique de code via OpenAPI
Ce projet illustre les concepts clés du cours Introduction à l'Intergiciel :
| Concept | Implémentation |
|---|---|
| Composition de services SOA (Mashup) | Combinaison de 3 APIs distinctes |
| Appels parallèles | CompletableFuture.allOf() - temps total = max(latences) |
| WebClient (réactif) | Appels HTTP non-bloquants |
| Cache (Fielding) | Redis avec TTL 10 minutes |
| Circuit Breaker | Resilience4j pour la résilience |
L'approche parallèle offre un gain significatif : Mode Séquentiel : ~900ms (Somme des 3 appels) Mode Parallèle : ~300ms (Maximum des 3 appels) Gain : 3x plus rapide !
| Composant | Technologie | Version |
|---|---|---|
| Framework | Spring Boot | 3.2.4 |
| Langage | Java | 17 |
| Cache | Redis | 7.0 |
| Containerisation | Docker | 24.0 |
| Documentation API | OpenAPI | 3.1 |
| Génération code | OpenAPI Generator | 7.5.0 |
| Circuit Breaker | Resilience4j | 2.2.0 |
| Mapping | MapStruct | 1.5.5 |
| Réduction boilerplate | Lombok | latest |
┌─────────────────┐
│ Client HTTP │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Controller │
└────────┬────────┘
│
▼
┌─────────────────┐
│ AgendaService │
└────────┬────────┘
│
┌────────────────────┼────────────────────┐
│ │ │
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│WeatherService │ │ EventService │ │ RecoService │
│ (Météo) │ │ (Événements) │ │ (Recommand.) │
└───────┬───────┘ └───────┬───────┘ └───────┬───────┘
│ │ │
└───────────────────┼───────────────────┘
│
┌───────▼───────┐
│ Redis Cache │
└───────────────┘# Java 17+
java -version
# Docker & Docker Compose
docker --version
docker-compose --version
# Maven
mvn --versiongit clone https://github.com/ASSONDJI/WeatherEventMashup.git cd WeatherEventMashup
docker-compose up -d
mvn clean compile
mvn spring-boot:run
Pour utiliser les vraies APIs, définissez les variables d'environnement : export OPENWEATHER_API_KEY=votre_clé_ici export TICKETMASTER_API_KEY=votre_clé_ici
Une fois l'application démarrée :
Swagger UI : http://localhost:8080/swagger-ui.html
OpenAPI JSON : http://localhost:8080/api-docs
Méthode Endpoint Description
- GET /api/v1/health Vérification de santé du service
- GET /api/v1/agenda?city=Paris&date=2024-12-25 Agenda complet (appels parallèles)
- GET /api/v1/agenda/benchmark?city=Paris&date=2024-12-25 Benchmark séquentiel vs parallèle
- GET /api/v1/health/circuit-breakers Statut des circuit breakers
curl http://localhost:8080/api/v1/health
curl "http://localhost:8080/api/v1/agenda?city=Paris&date=2024-12-25"
curl "http://localhost:8080/api/v1/agenda/benchmark?city=Paris&date=2024-12-25"
{
"city": "Paris",
"date": "2024-12-25",
"weather": {
"city": "Paris",
"condition": "Sunny",
"temperature": 22.5,
"feelsLike": 23.0,
"humidity": 65,
"description": "Pleasant weather"
},
"events": [
{
"id": "1",
"name": "Jazz Festival",
"venue": "Downtown Theater",
"category": "Music"
}
],
"recommendations": [
{
"activity": "Visit Historic Center",
"venue": "Paris Old Town",
"priority": 1
}
],
"processingTimeMs": 312,
"mode": "PARALLEL"
}WeatherEventMashup/
│
├── src/
│ └── main/
│ ├── java/com/mashup/
│ │ ├── WeatherEventMashupApplication.java
│ │ │
│ │ ├── config/
│ │ │ ├── WebClientConfig.java
│ │ │ └── RedisConfig.java
│ │ │
│ │ ├── controller/
│ │ │ ├── AgendaController.java
│ │ │ └── HealthController.java
│ │ │
│ │ ├── service/
│ │ │ ├── AgendaService.java
│ │ │ ├── WeatherService.java
│ │ │ ├── EventService.java
│ │ │ └── RecommendationService.java
│ │ │
│ │ ├── dto/
│ │ │ └── generated/ # Généré par OpenAPI
│ │ │ ├── WeatherResponse.java
│ │ │ ├── EventResponse.java
│ │ │ ├── RecommendationResponse.java
│ │ │ └── AgendaResponse.java
│ │ │
│ │ ├── api/ # Généré par OpenAPI
│ │ │ ├── AgendaApi.java
│ │ │ └── HealthApi.java
│ │ │
│ │ └── exception/
│ │ ├── CityNotFoundException.java
│ │ └── GlobalExceptionHandler.java
│ │
│ └── resources/
│ ├── application.yml
│ └── openapi.yaml
│
├── docker-compose.yml
├── pom.xml
└── README.md- Client → GET /api/v1/agenda?city=Paris
- Controller → reçoit la requête
- AgendaService → lance 3 appels en PARALLÈLE
- WeatherService → interroge API météo (ou mock)
- EventService → interroge API événements (ou mock)
- RecoService → génère recommandations
- Agrégation → combine les 3 résultats
- Réponse → JSON renvoyé au client
- Mode SÉQUENTIEL : Weather + Events + Recos = 550ms
- Mode PARALLÈLE : MAX(Weather, Events, Recos) = 200ms
- GAIN : 2.75x plus rapide
Étudiant : MALAIKA LADEESSE ASSONDJI
Encadré par : Pr. BOMGNI Alain Bertrand
- Cours : Introduction à l'Intergiciel (Middleware)
- Année académique : 2025/2026
Licence MIT
- OpenWeatherMap pour l'API météo
- Ticketmaster pour l'API événements
- La communauté OpenAPI Generator