带有Dubbo的Spring Cloud Alibaba

SpringCloudAlibaba微服务架构搭建(六)Dubbo 实战 面向接口代理:调用接口的方法,在A服务器调用B服务器的方法,由dubbo实现对B的调用,无需关心实现的细节,就像MyBatis访问Dao的接口,可以操作数据库一样。不用关心Dao接口方法的实现。这样开发是方便,舒服的。 阅读详情

通过优锐课的java学习分享,看一下如何在阿里巴巴的Spring Cloud实现中使用这个流行的RPC框架。
Spring Cloud Alibaba

Spring Cloud Alibaba是Alibaba Cloud的Spring Cloud版本。 它由几个阿里巴巴的开源项目Nacos,Sentinel和RocketMQ以及几个阿里云原生商业产品组成,以增强用户在阿里云上的体验。 Spring Cloud Alibaba的新版本还将提供Dubbo作为RPC选择。

Dubbo是一个经过严格实践的RPC框架。 在另一篇文章中,我演示了如何将其与注释一起使用。 该示例使用的是Spring Boot。 Dubbo与Spring Boot紧密集成。 将Dubbo放在Spring Cloud Alibaba上似乎很自然。
在本文中,我们将使用一个简单的echo示例来说明在Spring Cloud Alibaba上使用Dubbo的步骤。

定义Dubbo接口
首先定义一个接口:

public interface EchoService {
    String echo(String message);
}

该接口将向远程客户端公开。 这里的提示是将此接口打包到第二或第三方工件(jar)中,以便该jar可用于spring-cloud-dubbo-sample-api。

实施Dubbo服务
在Maven中创建一个项目

让我们用artifactIdId spring-cloud-dubbo-server-sample创建一个Maven项目。 然后,将依赖项添加到pom.xml中。。

<dependencies>
    <!-- Sample API -->
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-dubbo-sample-api</artifactId>
        <version>${project.version}</version>
    </dependency>
    <!-- Spring Boot dependencies -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-actuator</artifactId>
    </dependency>
    <!-- Dubbo Spring Cloud Starter -->
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-dubbo</artifactId>
    </dependency>
  
Spring Cloud Alibaba 同时兼容dubbo与openfeign Spring Cloud Alibaba 整合dubbo与openfeign 阅读详情

相关推荐

【云原生】Spring Cloud Alibaba 之 Feign 远程调用 实战

分布式系统下远程调用该如何选择?RestTemplate 与 Feign,Feign是最佳选择!

wanghuichen的博客 6443

Spring Cloud Alibaba 整合Nacos实战

Spring Cloud Alibaba 整合Nacos

congge_study的博客 7898

Spring Cloud Alibaba系列教程——Spring Cloud Alibaba开篇

随着Spring Cloud Alibaba的发展,Spring Cloud Alibaba的相关组件逐渐的成熟,对于它的学习和研究已经是java开发人员的趋势。这篇博文主要内容是介绍什么是Spring Cloud Alibaba,Spring Cloud 与Spring Cloud Alibaba的关系,以及我们为什么要学习它,以及畅想Spring Cloud Alibaba未来发展。

努力+坚持,而且还很年轻 6652

直线电机驱动技术原理与应用解析

直线电机作为直接电能-直线运动转换装置,其核心原理基于电磁感应定律和洛伦兹力公式。通过三相交流电在定子绕组中产生行波磁场,与动子永磁体相互作用实现精准推力控制。相比传统旋转电机传动系统,直线电机具有零传动间隙、高动态响应(加速度可达10g)和微米级定位精度等技术优势,这使其成为半导体光刻机、精密数控机床等高端装备的关键驱动部件。现代直线电机驱动单元通常采用三环控制架构(电流环、速度环、位置环),配合SiC功率器件和高分辨率光栅反馈,实现纳米级运动控制。随着模块化设计和直接冷却技术的发展,直线电机正朝着更高功

weixin_26802933的博客 259

【SABRE 3D, SABRE 3DxT,LAM设备】2025年9月13日-安全配置-准备工作

请遵循本规程将SABRE 3D/3DxT/3D Scimitar系统设置为安全配置,以便能够在电镀单元、APT模块、XMM(或SRD)模块、工厂接口(FI)外壳或中央通道内部及周边区域执行作业p104-p117。在生产过程中暂停调度程序存在一定风险:若待维护模块未离线且在其他模块完成处理前重启调度程序,可能对生产晶圆造成影响。维护人员需特别注意电镀模块内的晶圆状态,并尽可能快速地恢复调度程序。确认待维护模块内无晶圆滞留暂停调度程序并将相应模块设置为离线状态打开模块检修门并关闭安全盖板(槽位)

weixin_46735260的博客 1367

IMU自动校准论文与代码实现A Robust and Easy to Implement Method for IMU Calibration without External Equipments

PART1 摘要 低成本的惯性测量单元会受到系统误差的影响,系统误差由标度因子和轴偏差造成,这会降低位置和姿态估计的精度。 本文提出了一种无需任何外部设备的,鲁棒性强,易于实现的IMU校准方法。 该程序基于多放置方案,再估计传感器偏差的同时,为加速度和陀螺仪三轴的尺度和偏差系数。我们的方法只需要用手移动传感器,并将其放置在一组不同的静态位置(姿态)。 论文描述了一个鲁棒的快速校准协议,...

qq_29313679的博客 5308

海康威视iSC平台视频流对接:RTSP、HLS、WS三种协议到底该怎么选?

本文深入分析海康威视iSC平台视频流对接中RTSP、HLS和WebSocket三种协议的优缺点,帮助开发者根据实时性、兼容性和网络环境做出最优选择。特别适合综合安防管理平台的Web视频监控系统开发,提升用户体验和系统性能。

weixin_28365523的博客 691

Hermes 教程 05:多 Agent 编排

本文介绍了Hermes v0.13.0中的四种多Agent协作模式:1)delegate_task快速子任务模式,适合2-3个独立并行任务;2)spawn子Agent模式,实现零成本并行多步流水线;3)tmux交互子Agent模式,支持长期自主任务;4)全新Kanban看板系统,提供持久化AI团队协作框架。各模式在隔离级别、时长、工具访问和适用场景上存在差异,其中spawn模式通过独立上下文窗口实现零上下文成本。文章详细说明了每种模式的使用方法、限制条件和典型应用场景,并提供了具体代码示例和可视化流程图。K

程序猿_三产 537

微信小程序|基于小程序+云开发制作一个菜谱小程序

今天吃什么?这是一个让强迫症左右为难的问题,跟随此文基于小程序+云开发制作一个菜谱小程序,根据现有食材一键生成菜谱,省心又省力。

商务合作 / 项目定制 / 学习交流。个人vx:lovely_wml 1万+

【WRF湿度调整策略】WRF/ERA5湿度数据对比

【WRF湿度调整策略】WRF/ERA5湿度数据对比

WW、forever的博客 118

电子科技大学计算机预推免(最终去向)

电子科技大学,预推免报名时必须要有一封本校老师写的推荐信,推荐信基本上就是复试的入场券,所以一定要提前联系老师,拿到推荐信。只要有机会进了面试,我觉得老师对于双非并不歧视,面试的个人表现才是关键性决定因素,技巧性也是很强的,如果有需要帮助的,欢迎私信~~

D1379951481的博客 3367

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

上一篇: Spring MVC:HTTP消息转换器
下一篇: Netty:可能是世界上最好的包装结构
程序员plus
博客等级 码龄8年 41粉丝 151原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值