Try not to use @Service after using dubbo, which may cause conflicts

Several packages below contain @Service

The latest version of dubbo 2.7.8, @Service has been replaced by @DubboService

Insert picture description here

Example implementation class

package com.dubboprovider.service;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;

//zookeeper 服务注册与发现

//使用dubbo后尽量不用要@Service可能引起冲突
@Component
//@Service
@DubboService //DubboService在项目启动就会被注册到注册中心
public class ProviderImpl implements Provider {
    
    
    @Override
    public String getProvider() {
    
    
        return "获取服务";
    }
}

Guess you like

Origin blog.csdn.net/weixin_44371237/article/details/113770236