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

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

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