大战熟女丰满人妻av-荡女精品导航-岛国aaaa级午夜福利片-岛国av动作片在线观看-岛国av无码免费无禁网站-岛国大片激情做爰视频

專注Java教育14年 全國(guó)咨詢/投訴熱線:400-8080-105
動(dòng)力節(jié)點(diǎn)LOGO圖
始于2009,口口相傳的Java黃埔軍校
首頁(yè) hot資訊 Dubbo注解方式

Dubbo注解方式

更新時(shí)間:2021-09-07 11:47:15 來(lái)源:動(dòng)力節(jié)點(diǎn) 瀏覽1564次

注解配置

服務(wù)提供方

Service注解暴露服務(wù)

import com.alibaba.dubbo.config.annotation.Service;
@Service(timeout = 5000)
public class AnnotateServiceImpl implements AnnotateService { 
    // ...
}

javaconfig形式配置公共模塊

@Configuration
public class DubboConfiguration {
    @Bean
    public ApplicationConfig applicationConfig() {
        ApplicationConfig applicationConfig = new ApplicationConfig();
        applicationConfig.setName("provider-test");
        return applicationConfig;
    }
    @Bean
    public RegistryConfig registryConfig() {
        RegistryConfig registryConfig = new RegistryConfig();
        registryConfig.setAddress("zookeeper://127.0.0.1:2181");
        registryConfig.setClient("curator");
        return registryConfig;
    }
}

指定dubbo掃描路徑

@SpringBootApplication
@DubboComponentScan(basePackages = "com.alibaba.dubbo.test.service.impl")
public class ProviderTestApp {
    // ...
}

服務(wù)消費(fèi)方

Reference注解引用服務(wù)

public class AnnotationConsumeService {
    @com.alibaba.dubbo.config.annotation.Reference
    public AnnotateService annotateService;
    
    // ...
}

javaconfig形式配置公共模塊

@Configuration
public class DubboConfiguration {
    @Bean
    public ApplicationConfig applicationConfig() {
        ApplicationConfig applicationConfig = new ApplicationConfig();
        applicationConfig.setName("consumer-test");
        return applicationConfig;
    }
    @Bean
    public ConsumerConfig consumerConfig() {
        ConsumerConfig consumerConfig = new ConsumerConfig();
        consumerConfig.setTimeout(3000);
        return consumerConfig;
    }
    @Bean
    public RegistryConfig registryConfig() {
        RegistryConfig registryConfig = new RegistryConfig();
        registryConfig.setAddress("zookeeper://127.0.0.1:2181");
        registryConfig.setClient("curator");
        return registryConfig;
    }
}

指定dubbo掃描路徑

@SpringBootApplication
@DubboComponentScan(basePackages = "com.alibaba.dubbo.test.service")
public class ConsumerTestApp {
    // ...
}

以上就是動(dòng)力節(jié)點(diǎn)小編介紹的"Dubbo注解方式",希望對(duì)大家有幫助,想了解更多可查看Dubbo教程。動(dòng)力節(jié)點(diǎn)在線學(xué)習(xí)教程,針對(duì)沒(méi)有任何Java基礎(chǔ)的讀者學(xué)習(xí),讓你從入門到精通,主要介紹了一些Java基礎(chǔ)的核心知識(shí),讓同學(xué)們更好更方便的學(xué)習(xí)和了解Java編程,感興趣的同學(xué)可以關(guān)注一下。

提交申請(qǐng)后,顧問(wèn)老師會(huì)電話與您溝通安排學(xué)習(xí)

  • 全國(guó)校區(qū) 2025-04-24 搶座中
  • 全國(guó)校區(qū) 2025-05-15 搶座中
  • 全國(guó)校區(qū) 2025-06-05 搶座中
  • 全國(guó)校區(qū) 2025-06-26 搶座中
免費(fèi)課程推薦 >>
技術(shù)文檔推薦 >>
主站蜘蛛池模板: 亚洲天码中文字幕第一页 | 久久免费观看爱情动作片 | 国产区精品一区二区不卡中文 | 久操美女| 亚洲国产高清美女在线观看 | 色婷婷综合久久久久中文一区二区 | 99爱视频在线 | 奇米第四色视频 | 国产二区三区毛片 | 麻豆亚洲一区 | 激情四播 | 婷婷开心激情 | 亚洲综合国产 | 国产成人精品午夜二三区 | 亚洲欧美日韩中文字幕网址 | 国产91久久久久久久免费 | 97天天干 | 国产精品揄拍100视频 | 99热网址| 免费福利在线 | 日韩色吧| 俺去鲁婷婷六月色综合 | 一本大道久久香蕉成人网 | 黄色网址视频在线播放 | 欧美一级毛片免费看视频 | 中文字幕欧美日韩va免费视频 | 日本中文在线观看 | 免费 黄 色 人成 视频 | 午夜精品福利视频 | 亚洲天堂777 | 久久久久久久久66精品片 | 欧美日本高清 | 国产网红福利 | 五月激情综合婷婷 | 狠狠色丁香婷婷久久 | 欧美日韩在线观看区一二 | 在线500福利视频国产 | 久久精品麻豆 | 高清欧美一区二区免费影视 | 伊人婷婷色香五月综合缴缴情 | 欧美在线不卡 |