Step 11 of 21
·
4 minutes
Fair Play
The Scenario
American Express charges higher fees than Mastercard, but their payments
are processed at the same rate. Amex cardholders expect premium service.
We need to process more payments for premium cards while still being fair to everyone.
The Challenge
How do we process more payments for premium cardholders while still being fair to everyone?
The Solution
Use
Dynamic Queues with Weighted Round-Robin:
# In application.properties
jobrunr.jobs.dynamic-queue.weighted-round-robin.label-prefix=cardType:
jobrunr.jobs.dynamic-queue.weighted-round-robin.queues.AMERICAN_EXPRESS=5
jobrunr.jobs.dynamic-queue.weighted-round-robin.queues.MASTERCARD=1
American Express cardholders get 5 payments processed for every 1 Mastercard payment.
No one gets starved, but premium cards get premium treatment!
Read the documentation →
Try It Yourself
Trigger payments for both American Express and Mastercard holders.
Watch Amex payments complete 5x faster on average!
You need to log in to perform write operations. You can still view the code solution and dashboard.