1. Install RebbitMq

docker run -d –name ml-rabbit -e RABBITMQ_DEFAULT_USER=user -e RABBITMQ_DEFAULT_PASS=password -p 5672:5672 -p The rabbitmq, 15672-15672:3.8.3 – management

2. Add dependencies

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-stream-binder-rabbit</artifactId>
</dependency>
Copy the code

3. Add the configuration

spring:
  rabbitmq:
    host: 139.196160.176.
    port: 5672
    username: jkeep_dev
    password: jkeep
   cloud:
    stream:
      bindings:
        Configure which middleware your defined channels interact with
        demo_output: # to send
          destination: demo
          content-type: text/plain  The sender must be configured
        demo_input: # to receive
          destination: demo
Copy the code

4.