Skip to content

dilaverdemirel/spring-cloud-stream-outbox-extension-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This application is an example for Spring Cloud Stream Outbox Extension. It shows Spring Cloud Stream Outbox Extension how is work.

Features

  • Uses Spring Cloud Stream
  • Uses in memory db
  • Works with RabbitMQ

Cloud Stream Channel Name : stockOperationOutputChannel RabbitMq Exchange Name : stock-service.operation

Run

Before run the applications, you need a RabbitMQ instance.

docker run -d --name my-rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management

You can access RabbitMQ management console over http://localhost:15672/

For run the applications;

mvn clean package
mvn spring-boot:run

After that, you can access payment service on http://localhost:5000/swagger-ui.html

Or you can send manually a request for payment to payment service;

curl -X POST "http://localhost:5000/payments" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"id\": \"payment-id\", \"price\": -1, \"quantity\": 1, \"stockItemId\": \"red-pen-1\"}"

If you want to see outbox messages;

curl -X GET "http://localhost:5000/outbox-messages" -H "accept: */*"

About

It shows spring-cloud-stream-outbox-extension how is work.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages