https://github.com/ravening/spring-cloud-stream-rabbitmq
Spring boot application to implement messaging using cloud stream rabbitmq
https://github.com/ravening/spring-cloud-stream-rabbitmq
amqp cloud-stream-rabbitmq docker java maven microservices rabbitmq spring-boot spring-cloud-stream-rabbitmq
Last synced: 3 months ago
JSON representation
Spring boot application to implement messaging using cloud stream rabbitmq
- Host: GitHub
- URL: https://github.com/ravening/spring-cloud-stream-rabbitmq
- Owner: ravening
- Created: 2019-10-28T13:36:34.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-11-15T23:32:17.000Z (about 3 years ago)
- Last Synced: 2025-02-01T22:13:24.208Z (11 months ago)
- Topics: amqp, cloud-stream-rabbitmq, docker, java, maven, microservices, rabbitmq, spring-boot, spring-cloud-stream-rabbitmq
- Language: Java
- Size: 27.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Spring boot Cloud Stream RabbitMQ
Start the rabbitmq docker using
```
docker run -d --hostname my-test-rabbit --name test-rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management
```
default credentials are
```
guest/guest
```
Access ui on http://localhost:15672
Using the shared model between services
The model is in user-view-dto component.
Compile it using
```
mvn package -DskipTests
```
Copy the jar file to the local maven repository using
```
mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=target/user-view-dto-0.0.1.jar -DgroupId=com.rakeshv -Dartifactid=user-view-dto -Dversion=0.0.1 -Dpackaging=jar -DlocalRepositoryPath=/root/.m2
```
Add the below dependency in the pom.xml of the component which uses this model
```
com.rakeshv
user-view-dto
0.0.1
```
Add the local repository
```
local
Local repo
file:/root/.m2
```
Implementing spring boot amqp using rabbitmq
This uses a user defined queue and exchange name.
Producer sends a message of type "Order" and consumer receives it
By default producer sends the data in the byte format.\
To convert it into json we need to override certain configurations.\
Also we need to override configuration on the listener side so that\
listener recives the message in json format