An open API service indexing awesome lists of open source software.

https://github.com/parths049/spring-boot-jms


https://github.com/parths049/spring-boot-jms

jms jms-broker jms-queue jpa mysql rest-api spring-activemq spring-boot swagger-ui

Last synced: 8 months ago
JSON representation

Awesome Lists containing this project

README

          

You ultimate goal will be to create two services, service A and service B, and use a messaging system to connect them to single business process.

##### Mandatory Acceptance criterias:
- Service A will send messages to service B
- Service B will track a balance containing money in some storage. It will receive messages from service A and add to the balance accordingly.
- Services have no concept of "users", and this kind of development is not necessary for task at hand.
- No authentication is necessary on any of the services
- "EUR" should be the only supported currency in this initial version.
- Both services must be documented with README.md files explaining following, project purpose, how to setup it, how to run it.

##### Bonus points:
- Services as docker containers
- Unit test
- Handling concurrent messages on Service B

## Service A

Service A has two task:
1) Accept HTTP request that carry money information
2) Generate AMQP messages towards "Service B"

##### HTTP API

- HTTP API must be able to accept following HTTP payload:

```json
{
"amount": 1123.4,
"currency": "EUR",
}
```

- Amount is sent as decimal representation.
- Amount property must not be lower than -100000000 EUR, and larger than +100000000 EUR.
- Valid requests must generate HTTP/200 requests
- Invalid requests must generate HTTP/400 responses
- HTTP API must be documented via projects README.md

##### Messaging API

- Messaging API must generate valid messages for Service B to consume after HTTP api described above is invoked.
- All Messaging infrastructure (except definitions necessary for service B to consume messages) must be defined as part of service A
- Example message sent over message broker:
```json
{
"amount": 112304,
"currency": "EUR",
}
```
- Amount is sent as minimal currency denomination representation (e.g. cents, this means that 1 EUR is sent as amount 100, and 100.19 EUR is sent as amount 10019)

##### Tech requirements (use one of following)
- Language: PHP, Java, golang
- Messaging: Any AMQP broker (e.g. Rabbit MQ)

## Service B

- Service accepts AMQP messages generated by Service A
- Service must have **account** entity stored in database, described by two properties, **balance** and **updatedAt**

##### Handling messages

- Initial **balance** must be set at **0**
- Initial **updatedAt** must be set at **NULL**

As a result of each message processing, following must happen:
- Balance must increased or decreased based on **amount** property
- **updatedAt** property must be updated so that it reflect last balance change

##### HTTP API

- HTTP API must have single route that exposes state of balance

##### Tech requirements (use one of following)
- Language: PHP, Java, golang
- Storage: Mariadb/Mysql, PostgreSql

## Donation
If this project help you reduce time to develop, you can give me a cup of coffee :)

[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.me/parthsolanki49)