SpringCloud项目接入华为云Paas平台CES一些注意事项

在Spring Boot中使用华为云微服务CSE 概述   Spring Boot可以让开发者能够更加快速的构建Spring应用。主要提供了如下功能: 创建独立可执行的Spring应用。通过将应用程序打包为jar,就可以通过java -jar来执行应用程序。 内嵌Tomcat, Jetty等WEB服务器,而不需要开发者打包war。 提供starter简化maven依赖关系配置。 将Spring Boot用于微服务... 阅读详情

1.注册华为云账号获取个人中心-》管理我的凭证-》访问密钥-》下载ak,sk密钥。

2.本地项目maven需要配置华为云私服

 <profile> 
		<id>nexusProfile</id> 
			<repositories> 
				<repository> 
					<id>cse1</id>
					<url>http://maven.huaweicse.com/nexus/content/groups/public/</url> 
				</repository> 
			</repositories> 
    </profile>

</profiles>

<activeProfiles> 
		<activeProfile>nexusProfile</activeProfile> 
</activeProfiles>

​

3.父工程和子工程的Pom文件jar包处理

 <dependencies>
            <!-- 取消cloud的配置,引用ces配置 -->
            <!--<dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Dalston.SR5</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>-->
            <dependency>
                <groupId>com.huawei.paas.cse</groupId>
                <artifactId>cse-dependency</artifactId>
                <version>${cse.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

子工程:

 <dependency>
            <groupId>com.huawei.paas.cse</groupId>
            <artifactId>cse-solution-service-engine</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicecomb</groupId>
            <artifactId>spring-boot-starter-provider</artifactId>
        </dependency>

4.microservice.yaml配置文件处理

5.注解及代码注意事项

1.因为serviceComb已经提供swagger的,所以本地代码无需配置

2.注释restController 和 controller上必须显示声明requestmapping

3.如果是Get查询请求,需要请求参数使用基本类型对象

4.启动类无需使用本地fegin和加上serviceComb启动注解

华为云接入springcloud项目demo步骤以及注意事项(包括替换eureka和feign方案) 今天我们讲一下如何将springcloud项目整合到华为云上进行服务管控。 首先是pom文件的导入,我们首先要将华为云的镜像放入到我们Maven的setting.xml中。具体导入内容为: <mirrors> <mirror> <id>huaweicloud</id> <mirrorOf>*,!HuaweiCloudSDK... 阅读详情

相关推荐

从PWM到精准电流:双光耦与LM317构建的4-20mA隔离输出方案

本文详细介绍了基于双光耦与LM317的4-20mA隔离输出方案,适用于工业自动化中的PWM信号转换。该方案通过电气隔离和精准电流调节,显著提升抗干扰能力和信号传输精度,同时降低成本60%。文章还分享了电路设计、参数计算及调试经验,为工程师提供实用参考。

weixin_32006655的博客 292

Spring Cloud应用接入华为云微服务CSE

概述   Spring Cloud应用可以方便的接入CSE提供的基础服务。接入CSE服务有如下好处: 开发者可以专注于业务系统的开发,把精力从中间件的可靠性评估、集群部署、运维监控等复杂的事情中解放出来。 实现业务快速交付和敏捷开发。利用PaaS平台,根据业务规模,动态的调整资源使用,降低业务风险。 下图展现了CSE基础服务、PaaS平台服务和第三方服务的关系: CS...

qq_43620668的博客 4699

Linux中断子系统(二)—— 通用框架处理

1、数据结构分析 (1)中断描述符结构structirq_desc: 1)打开CONFIG_SPARSE_IRQ宏(中断编号不连续),中断描述符以radix- tree来组织,用户在初始化时进行动态分配,然后再插入radix-tree中; 2)关闭CONFIG_SPARSE_IRQ宏(中断编号连续),中断描述符以数组的 形式组织,并且已经分配好; 3)不管哪种形式,最终都可以通过linuxirq号来找到对应的中断描述符; (2)stru...

weixin_38428439的博客 4876

跟我学CSE系列之5:Spring Cloud应用如何接入华为云微服务引擎CSE

本章节通过一个实际的案例,说明Spring Cloud应用如何经过少量的配置修改,快速接入CSE。原始Spring Cloud应用下载地址:https://github.com/huawei-microservice-demo/SpringCloudIntegration/tree/master/springcloud-sample该Spring Cloud应用提供了3个项目:eureka-ser...

微服务技术与实践专栏 2378

SpringBoot3.X及SpringAi和jdk17以上版本集成MCP协议供大模型调用sse协议

MCP(Model Context Protocol,模型上下文协议)是由 Anthropic 推出的开源协议,旨在实现大型语言模型(LLM)与外部数据源和工具的无缝集成,用来在大模型和数据源之间建立安全双向的链接。目标是成为 AI 领域的“HTTP 协议”,推动 LLM 应用的标准化和去中心化。本文主要讲解SpringBoot3.X版本和jdk17版本如何集成MCP协议 后续还有一个SpringBoot2.7和jdk1.8通过solon来实现@Service。

weixin_47247523的博客 793

Cadence仿真笔记(二):传统noise仿真—共源极的噪声

cadence中进行传统噪声仿真

Bao_xue的博客 1万+

手把手教你实现:将后端SpringBoot项目部署到华为云服务器上

前提:有一个后端项目,项目能够运行在本地,可以通过本地访问(localhost)一个基于SpringBoot的后端项目最后就是你正常访问你的后端项目API了。接口域名:http://124.71.83.237:8080接口路径:/register请求方式:POST请求体参数:返回结构:"message": "操作成功","data": []

qq_41904106的博客 6323

【AI智能体】AI 编程 + 飞书CLI + Skills 重塑开发新范式实战操作详解

AI 编程 + 飞书CLI + Skills 重塑开发新范式实战操作详解

congge 3677

如何解决华为云CSE微服务注册失败问题?

如何解决微服务注册失败问题?微服务部署成功后,需要将微服务注册到服务中心和配置中心,才能使用注册发现和微服务治理能力。如果注册失败,可能由于以下因素导致的:AK/SK未配置或者配置不正确。服务中心或配置中心地址配置不正确。网络不通。域名解析失败。监听端口被占用。操作步骤查看microservice.yaml文件中AK/SK是否配置正确。 credentials: accessKey...

微服务技术与实践专栏 2310

SAP GR(Group Reporting)配置篇(五)

1.5、合并的货币换算1.5.1指定折算比率菜单路径组报表的SAP S4HANA >合并的货币换算>-指定折算汇率事务代码GCRF说 明1.5.2维护汇率菜单路径组报表的SAP S4HANA >合并的货币换算>维护汇率事务代码CXCC/OB08说 明实际测试的时候根据实际情况维护汇率。输入换算比率。1.5.3定义汇率标识符菜单路径组报表的SAP S4HANA >合并的货币换算>定义汇率标识符事务代码OC41说 明配置了月末汇率和平均汇率。

weixin_43853754的博客 558

Claude Code 学习笔记之一:理解 Agentic Loop 与内置工具

本文介绍了Claude Code这一终端智能助手的工作原理与使用方式。作者从ABAP开发经验出发,指出学习Claude Code的高级用法具有长期价值。文章详细解析了Claude Code的Agentic Loop机制:通过大语言模型进行推理,借助各类工具执行任务,并循环收集上下文、执行操作、验证结果三个步骤。系统阐述了Claude Code支持的五大类工具及其扩展方式,说明了其访问本地资源的范围和自治处理能力,同时介绍了权限模式等安全机制。最后提供了从小任务开始、充分探索、及时引导、使用CLAUDE.md

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 558

Spring Cloud Alibaba 组件版本选择

下表为按时间顺序发布的 Spring Cloud Alibaba 以及对应的适配 Spring Cloud 和 Spring Boot 版本关系(由于 Spring Cloud 版本命名有调整,所以对应的 Spring Cloud Alibaba 版本号也做了对应变化)如果需要使用 Spring Cloud Greenwich 版本,请在 dependencyManagement 中添加如下内容。Spring Cloud Alibaba BOM 包含了它所使用的所有依赖的版本。

a749227859的博客 5456

hwasan实例分析踩内存之一:camx进程stack tag-mismatch的三种解决方案

hwasan实例分析踩内存之一:camx进程stack tag-mismatch的三种解决方案。

1308

连接CSE服务中心失败的排查步骤

背景介绍:在使用华为微服务引擎CSE的时候,会遇到链接服务中心失败的情况,可能是某些设置有问题,可以先通过自己排查解决问题。 异常消息如下时,问题原因为AK/SK没有正确设置和携带到请求头里。 {"errorCode":"401002","errorMessage":"Request unauthorized","detail":"Invalid request, header is inv.

微服务技术与实践专栏 3134

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

跟我学CSE系列之7:使用CSE作为RPC框架

CSE作为一个独立的RPC框架实现,可以非常容易集成到Spring Cloud中。通过将Spring RESTful Web Service替换为CSE,可以给开发者带来如下便利:一致的开发体验。使用CSE的SpringMVC模式,可以获得和Spring RESTful Web Service一致的开发体验,包括一样的声明式Annotation,使用RestTemplate进行访问。更好的RPC支...

微服务技术与实践专栏 6093

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

跟我学CSE系列之4:基于华为云配置微服务

本章节主要描述微服务发布到华为公有云上。上云配置的基本原则是:只需要对microservice.yaml进行适当的配置,以及在pom中添加额外的依赖,就可以使用相关的功能。一键式配置公有云版本提供了一键式简化配置的方式,让基于开源版本开发的应用快速切换为云上应用,直接使用公有云提供的灰度发布、服务治理等功能。增加依赖关系(pom.xml)&lt;dependency&gt; &lt;grou...

微服务技术与实践专栏 5061

深度学习工具包 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")

springboot接入华为微服务引擎CSE全过程及后续遇到的问题一览

最近有项目需求把现有的单体应用,springboot接入华为的微服务引擎CSE,这里列出我遇到的问题,以及解决方案。

张遂程的博客 6232

云原生架构优化——架构改造迁移

微服务Apache Dubbo架构改造Spring Cloud架构,并迁移上华为云。

weixin_53439529的博客 902

Gordon与传统AWS CDK开发对比:为什么选择这款Python库?

在云基础设施即代码(IaC)领域,AWS CDK凭借其强大的功能和灵活性成为开发者的首选工具。然而,传统AWS CDK开发往往需要编写大量样板代码,这对于新手和追求效率的团队来说是不小的挑战。**Gordon**作为一款专为简化AWS CDK应用开发设计的Python库,通过提供简洁直观的API和多语言支持,正在改变开发者构建云应用的方式。本文将深入对比Gordon与传统AWS CDK开发的核心差

gitblog_00537的博客 1119

springcloud+vue项目部署上线---华为云

springcloud+vue项目部署上线---华为云

qq_51483032的博客 1409

零代码修改,教你Spring Cloud应用轻松接入CSE

本文介绍了Sermant Agent的接入原理和如何使用Sermant Agent无修改接入CSE。

华为云官方博客 1660

Spring Cloud Huawei 安装与配置指南

Spring Cloud Huawei 是一个开源框架,旨在简化使用 Spring Cloud 开发微服务的流程,并提高开发效率。它支持 Apache ServiceComb 和 Nacos 作为服务的发现、注册以及配置管理工具。Spring Cloud Huawei 提供了大量的服务治理功能,帮助开发者快速构建具有弹性和可靠性的微服务应用。 **主要编程语言**:Java ## 2. 关键技

gitblog_01177的博客 945

华为云CAE部署spring cloud服务

华为云serverless产品CAE中部署spring cloud微服务。

nangonghen的博客 1343

导入CSE JavaSDK 的demo工程,遇到maven依赖问题

有些同学在导入CSEJavaSDK的demo工程的时候,会发现maven依赖没有导入进来。代码中很多类都是红的,显示无法找到类: 此时大家可以跑一下mvn clean package构建命令,看看控制台里的输出日志: 关键日志如下: 1 Non-resolvableimportPOM:Failuretofindcom.huawei.paas....

微服务技术与实践专栏 1253

关于华为私有云部署若依springcloud微服务项目改造及部署

若依微服务改造

weixin_48342082的博客 2990
上一篇: Kubernetes 创建pod一直处于ContainerCreating 状态解决过程
下一篇: @Transactional事务不生效问题解决(springboot)
java_xth
博客等级 码龄9年 38粉丝 70原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址