This repository contains a sample payment processing system built using Bun and Kafka for messaging.
The Order Service is responsible for receiving and processing orders. It publishes order information to the orders
Kafka topic.
- Language: TypeScript
- File:
order-service.ts
The Payments Service processes payment transactions based on received orders. It publishes payment results to the payments
Kafka topic.
- Language: TypeScript
- File:
payments-service.ts
The Payments Consumer Test is a consumer application that listens to the payments
Kafka topic and prints payment information to the console.
- Language: TypeScript
- File:
paymentsConsumerTest.ts
Before running the services, ensure you have the following installed:
- Bun
- Kafka
-
Clone the repository:
git clone https://github.com/your-username/payment-processing.git cd app
-
Install dependencies:
bun install
-
Configure Kafka:
Make sure Kafka is running locally or update the Kafka broker addresses in the TypeScript files (
order-service.ts
,payments-service.ts
,paymentsConsumerTest.ts
) to point to your Kafka setup.
Run the Order Service to start receiving and processing orders.
bun run order-service.ts
Run the Payments Service to process payments and publish results to Kafka.
bun run payments-service.ts
Run the Payments Consumer Test to listen to payment results from the payments
topic.
bun run paymentsConsumerTest.ts
Feel free to contribute by opening issues or pull requests. Follow the contributing guidelines.