Spring Applications
Exercise: Booking Application
- Create a Postgres database
booking
.
- Implement a transactional travel service that allows customers to make travel bookings that consist of a flight and a hotel booking:
- Flights and hotels are booked separately by the booking service
- If one booking fails, the whole travel booking is canceled
- The booking attempts and possible failures are logged using the logging service
- Set the following logging levels to observe the transaction management to
DEBUG
.
logging.level.org.springframework.transaction.interceptor.TransactionInterceptor
logging.level.org.springframework.orm.jpa.JpaTransactionManager
- Run the
TravelServiceIT
integration test to test the service.
Solution