(Spring Cloud microservices in practice - the pit in the book) spring cloud Stream injection binding interface error bean definition with this name already exists

1. Requirements, within a service, message sending and message receiving

2. According to the online or book processing as follows:

Third, the result: error,

Invalid bean definition with name 'input' defined in XXXX.SinkSender: bean definition with this name already exists

Fourth, analyze the reasons

As can be seen from the above figure, in Sink.class and SinkSender.class of @EnableBinding, @Input and @Output both define Sink.INPUT with the same name.

5. Processing method

application.yml is modified as follows:

spring:
  cloud:
    stream:
      bindings:
        input:
          destination: raw-sensor-data
        output:
          destination: raw-sensor-data

SinkSender is modified as follows:

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324934304&siteId=291194637