We are developing travel application for booking flight, bus tickets etc. For the flight tickets initially PNR (Passenger Name Record) will be generated, through that PNR confirmation of ticket will be done.
The problem is, if ticket is not confirmed with in 12 hours after generating the PNR, the PNR has to be canceled. If not, we will face penalty from Air GDS provider.
Up to now we have written Cron Schedulers which does this thing for every 15 minutes. We have problems by doing like this, and faced penalty also. I can't run the schedulers every minute.
How can I cancel the PNR, after generating 12 hours if not booked.
Since this is tagged Java I recommend you to look into one of the following
java.util.Timer APIThese are the standard solutions to scheduling tasks that are to be executed in the future.
Ontop of aioobe suggestions, I'd also have a look at the ScheduledExecutorService and Cancelling scheduled executor because I'm pretty sure that would be the next question ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With