Integrating dubbo in the grilas project to send messages synchronously

1: This year's project was developed using the grails project. The leader said that the project needs to use a synchronized interface to send messages. After defining the dubbo interface, a problem was discovered. dubbo is local. If there is no registration center, an error will be reported during startup. It is said that dubbo cannot be registered. Debug found that the client started to instantiate before the server was instantiated, which caused registration problems


2: The tried method, put the configuration of loading the server in front of the client. But still unresolved.


3: Finally found. There is a configuration item in the config configuration of grails

grails.controllers.defaultScope = 'singleton'

After putting this comment later, it started normally. This configuration declares the controller as a single column, so the dubbo interface called in the controller is instantiated when it is started, so it is too late to instantiate the configuration of the dubbo server.

Regardless of whether the writing is useful to others, it is convenient for me to remember. The bad writing is welcome

Guess you like

Origin blog.csdn.net/lileronglilerong/article/details/51697724