Hospitality & Loyalty Systems
Loyalty Pricing Engine
Built Spring Boot consumers for Kafka and ActiveMQ and Python Lambdas that calculate and publish nightly loyalty point prices for every hotel.


Problem
Loyalty analysts decide how many points a hotel room costs each night, and the right price depends on demand, which changes constantly. Doing that by hand for every hotel does not scale. The inputs also come from several upstream systems that publish in different ways: forecast rates and occupancy over Kafka, and hotel configuration changes over ActiveMQ.
The goal was a backend that takes in those inputs, applies the business rules analysts configure, and publishes a points price for every room category of every hotel each night.
System Architecture
Small services, each with one job. Spring Boot consumers read from Kafka and ActiveMQ, a pricing manager stores the data and runs the nightly calculation, and Python Lambda functions start the work on a schedule. The flow above is a simplified illustration of that shape.
- Consumers for two brokers. Spring Boot services read forecast data from Kafka and hotel changes from ActiveMQ, keep only what pricing needs and pass it to the manager’s API.
- One pricing manager. A Spring Boot service stores the data, holds the rules analysts configure (defaults, per-hotel settings and overrides) and calculates the points price for each room category, each night.
- Serverless starters. A timed Lambda creates each night’s batch, and a second one, triggered through SNS, tells the manager to process it, so there is no always-on scheduler to run.
- Published results. Price decisions are published as events for other systems to consume.
Trade-offs
- Many small services over one application. Each consumer and starter can change and scale on its own, at the cost of more moving parts to deploy and monitor.
- Two brokers, one model. Supporting both Kafka and ActiveMQ let upstream systems keep publishing the way they already did, at the cost of two client libraries and two failure modes.
- A nightly batch over pricing on every event. Calculating once a night keeps results consistent and easy to audit, in exchange for prices that are only as fresh as the last batch.
- Serverless starters over a scheduler inside the service. There is nothing always-on to run, but the timing and call sequence live outside the manager and have to be monitored there.
Measurable Impact
- Loyalty point prices are calculated and published every night for each hotel’s room categories, without manual steps.
- Loyalty analysts configure rules, overrides and alerts themselves instead of requesting pricing changes from engineering.