Home > Back-end >  Spring cloud stream the rabbitmq study on pit
Spring cloud stream the rabbitmq study on pit

Time:11-30

The first pit:
Spring:
Application:
Name: stream - the rabbitmq
Cloud:
Stream:
Binders:
DefaultRabbit:
Type: rabbit
Environment:
Spring:
The rabbitmq:
Host: 8.8.8.8
Port: 5672
Username: admin
Password: admin
Virtual host:/
Bindings:
Input:
Destination: test123
The content-type: text/plain
Binder: defaultRabbit
According to the data, this configuration can be used, when I configuration after the start, the first problem, according to my host access configuration, can automatically access localhost rabbitmq, leading to the localhost access failure, haven't found what specific reasons, my solution
Spring:
Application:
Name: stream - the rabbitmq - consumer
Cloud:
Stream:
Bindings:
Input:
Destination: test123
The content-type: text/plain
The rabbitmq:
Host: 8.8.8.8
Port: 5672
Username: admin
Password: admin
Put out the rabbitmq configuration separate

The second pit
A nested exception is Java. Lang. An IllegalStateException: Failed to convert the message: "' the to outbound message . The error, send the message is always the message transformation error, try for a long time only to find that the original is to configure the content-type: text/plain, it is important to note what you fill out the type and if the type is wrong, can appear the error

The third pit
Configuration file inside the bindings configuration properties is invalid, no matter how to change, are not effective, because to be able to access, it is these configuration useless, cause group has no effect, then found the problem turns out to be in the @ EnableBinding (Barista. Class) injection class, is my own definition of injection Barista, load is the information in the Barista classes, has nothing to do with the configuration file, it should be annotated way, if you want to configure file to take effect, change into classes to Source classes

CodePudding user response:

Filling holes while improving
  • Related