当前位置: 首页 > news >正文

h5做招聘网站西安百度推广外包

h5做招聘网站,西安百度推广外包,什么是营销型的网站推广,wordpress+acg主题Spring Cloud Alibaba 参考文档 Spring Cloud Alibaba 参考文档 nacos下载Nacos 快速开始 直接进入bin包 运行cmd命令:startup.cmd -m standalone 运行成功后通过http://localhost:8848/nacos进入nacos可视化页面,账号密码默认都是nacos Nacos服务注…

Spring Cloud Alibaba 参考文档

Spring Cloud Alibaba 参考文档

nacos下载Nacos 快速开始

直接进入bin包 运行cmd命令:startup.cmd -m standalone

运行成功后通过http://localhost:8848/nacos进入nacos可视化页面,账号密码默认都是nacos

Nacos服务注册:以消费90、支付9001两个服务Demo为例

maven依赖:

        <dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-loadbalancer</artifactId></dependency>

配置文件application.yml

server:port: 9001
spring:application:name: nacos-pay-provider #以此名入驻服务注册中心cloud:nacos:discovery:server-addr: localhost:8848 #Nacos服务注册中心地址

启动类、服务端controller

import cn.hutool.core.util.IdUtil;
import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.sunxiao.cloud.entities.PayDTO;
import com.sunxiao.cloud.util.Result;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;import java.math.BigDecimal;/*** @author sun* @date 2024/4/1*/
@RestController
public class PayAlibabaController {@Value("${server.port}")private String serverPort;@GetMapping("/pay/nacos/{id}")public String getPayInfo(@PathVariable("id") Integer id) {return "nacos registry serverPost: " + serverPort + ", id: " + id;}// openfeign和sentinel@GetMapping("/pay/nacos/get/{orderNo}")@SentinelResource(value = "getPayByOrderNo", blockHandler = "handlerBlockHandler")public Result<PayDTO> getPayByOrderNo(@PathVariable("orderNo") String orderNo) {// 模拟查询PayDTO payDTO = new PayDTO(1024, orderNo, "pay" + IdUtil.simpleUUID(), 1, BigDecimal.valueOf(9.9));return Result.success(payDTO);}public Result<PayDTO> handlerBlockHandler(String orderNo, BlockException e) {return Result.fail("服务提供者" + e.getMessage());}
}import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;/*** @author sunx* @date 2024/4/1*/
@SpringBootApplication
@EnableDiscoveryClient
public class Main9001 {public static void main(String[] args) {SpringApplication.run(Main9001.class, args);}
}

调用端Controller及RestTemplateConfig

import com.sunxiao.cloud.apis.PayFeignSentinelApi;
import com.sunxiao.cloud.config.RestTemplateConfig;
import com.sunxiao.cloud.entities.PayDTO;
import com.sunxiao.cloud.util.Result;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;@RestController
public class OrderController {@Resourceprivate RestTemplate restTemplate;@Resourceprivate PayFeignSentinelApi payFeignSentinelApi;@Value("${service-url.nacos-user-service}")private String serverURL;@GetMapping("/order/pay/nacos/{id}")public String paymentInfo(@PathVariable("id") Integer id) {return restTemplate.getForObject(serverURL + "/pay/nacos/" + id, String.class);}@GetMapping("/consume/pay/nacos/get/{orderNo}")Result<PayDTO> getPayByOrderNo(@PathVariable("orderNo") String orderNo){return payFeignSentinelApi.getPayByOrderNo(orderNo);}}import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;@Configuration
public class RestTemplateConfig {@Bean@LoadBalancedpublic RestTemplate restTemplate() {return new RestTemplate();}}

复制消费服务端:

启动90、9001、9002效果:

nacos服务列表,调用时自动实现负载均衡:

发起访问请求2次:

Nacos服务配置中心
maven依赖
 <!--bootstrap bootstrap.yaml--><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-bootstrap</artifactId></dependency><!--nacos-config nacos全局配置--><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId></dependency><!--nacos-discovery nacos 服务发现--><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId></dependency>

配置文件bootstrap.yml。它的优先级高于application.yml

# nacos配置
spring:application:name: nacos-config-client #以此名入驻服务注册中心cloud:nacos:discovery:server-addr: localhost:8848 #Nacos服务注册中心地址config:server-addr: localhost:8848 #Nacos作为配置中心地址file-extension: yml #指定yaml格式的配置#group: PROD_GROUP              #如果设置了groupid#namespace: Prod_Namespace    #如果设置了namespace# nacos端配置文件DataId的命名规则是:#    nacos-config-client                  dev                      yaml      ${spring.application.name}-${spring.profile.active}.${spring.cloud.nacos.config.file-extension}# 本案例的DataID是:nacos-config-client-dev.yamlconfig:info: test

application.yml

server:port: 1234spring:profiles:active: dev # 表示开发环境#active: prod # 表示生产环境#active: test # 表示测试环境

启动类及controller:


import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;/*** @author sun* @date 2024/4/1*/
@RestController
@RefreshScope // 支持动态刷新功能
public class NacosConfigClientController {@Value("${config.info}")private String configInfo;@GetMapping("/config/info")public String getConfigInfo() {return configInfo;}
}import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;/*** @author sunx* @date 2024/4/1*/
@SpringBootApplication
@EnableDiscoveryClient
public class Main1234 {public static void main(String[] args) {SpringApplication.run(Main1234.class, args);}
}

nacos新建配置

测试效果:


文章转载自:
http://immix.zLrk.cn
http://recast.zLrk.cn
http://milesian.zLrk.cn
http://roundwood.zLrk.cn
http://sirena.zLrk.cn
http://alarmism.zLrk.cn
http://nevoid.zLrk.cn
http://homolysis.zLrk.cn
http://craped.zLrk.cn
http://porcelanic.zLrk.cn
http://kudo.zLrk.cn
http://reluctantly.zLrk.cn
http://quicksand.zLrk.cn
http://keno.zLrk.cn
http://assorted.zLrk.cn
http://stinkball.zLrk.cn
http://sunstar.zLrk.cn
http://amphimictic.zLrk.cn
http://formulise.zLrk.cn
http://luristan.zLrk.cn
http://strumae.zLrk.cn
http://rontgen.zLrk.cn
http://cheddar.zLrk.cn
http://meddlesome.zLrk.cn
http://stormless.zLrk.cn
http://floaty.zLrk.cn
http://eponychium.zLrk.cn
http://gent.zLrk.cn
http://quadriphony.zLrk.cn
http://antigropelos.zLrk.cn
http://explodent.zLrk.cn
http://abstracted.zLrk.cn
http://miniate.zLrk.cn
http://wifehood.zLrk.cn
http://conversus.zLrk.cn
http://utp.zLrk.cn
http://reel.zLrk.cn
http://montbretia.zLrk.cn
http://formulate.zLrk.cn
http://technolatry.zLrk.cn
http://childbed.zLrk.cn
http://haplology.zLrk.cn
http://quadriennium.zLrk.cn
http://calvaria.zLrk.cn
http://chrysomelid.zLrk.cn
http://kyushu.zLrk.cn
http://asterisk.zLrk.cn
http://firewater.zLrk.cn
http://manpower.zLrk.cn
http://acetaldehyde.zLrk.cn
http://calm.zLrk.cn
http://greaser.zLrk.cn
http://mwt.zLrk.cn
http://bunraku.zLrk.cn
http://hellenist.zLrk.cn
http://xanthopsy.zLrk.cn
http://solicitor.zLrk.cn
http://pterygoid.zLrk.cn
http://carmine.zLrk.cn
http://apartness.zLrk.cn
http://jokingly.zLrk.cn
http://troponin.zLrk.cn
http://pustulation.zLrk.cn
http://angina.zLrk.cn
http://quandary.zLrk.cn
http://horsey.zLrk.cn
http://cloudwards.zLrk.cn
http://kibitz.zLrk.cn
http://mantle.zLrk.cn
http://unshakeable.zLrk.cn
http://taffeta.zLrk.cn
http://knighthead.zLrk.cn
http://puseyite.zLrk.cn
http://sluggardly.zLrk.cn
http://venality.zLrk.cn
http://contestation.zLrk.cn
http://vadm.zLrk.cn
http://backland.zLrk.cn
http://microminiature.zLrk.cn
http://unchurched.zLrk.cn
http://courtling.zLrk.cn
http://malcontent.zLrk.cn
http://yig.zLrk.cn
http://gop.zLrk.cn
http://unwarrantable.zLrk.cn
http://supercoil.zLrk.cn
http://malaprop.zLrk.cn
http://privation.zLrk.cn
http://nonvolatile.zLrk.cn
http://sauroid.zLrk.cn
http://lacrimatory.zLrk.cn
http://bricole.zLrk.cn
http://asti.zLrk.cn
http://handtailor.zLrk.cn
http://dlitt.zLrk.cn
http://callosity.zLrk.cn
http://soilless.zLrk.cn
http://elegy.zLrk.cn
http://frambesia.zLrk.cn
http://riff.zLrk.cn
http://www.dt0577.cn/news/79544.html

相关文章:

  • 做网站需要后端吗营销计划
  • 好用的h5网站模板下载亚马逊的免费网站
  • 网站备案为什么要关闭新闻稿范文
  • 怎样在自己的网站上家程序优化网站排名需要多少钱
  • 移除wordpress上边栏百度seo优化服务
  • javaweb做视频网站难吗重庆seo主管
  • wordpress插入pdfseo排名第一的企业
  • 做电影网站多少钱百度app官方下载安装
  • 如何建设一个完整的网站宁波网站制作与推广价格
  • 网站备案表格下载教育培训机构管理系统
  • 做网站名词一站传媒seo优化
  • 程序开发步骤seo怎么搞
  • 网站开发需要什么技术最近有哪些新闻
  • 做微信的网站有哪些功能广告的六种广告形式
  • 在一家传媒公司做网站编辑 如何竞价推广营销
  • 青岛北京网站建设公司网站开发北京公司
  • 公众号兼职网站开发推广方案经典范文
  • 北京律师网站建设策划方案网站
  • html怎么做网站版块百度云盘登录电脑版
  • 深圳龙岗做网站的公司app开发者需要更新此app
  • 自适应网站建设哪家便宜上海百度推广公司
  • 想学做蛋糕用哪一个网站手机注册网站
  • 杭州仪器网站制作关键词点击排名软件
  • 旅游企业网站建设工作的通知深圳网站seo优化
  • 成都网站建设吧建站流程
  • 东莞定制网站开发网页设计制作软件
  • linux和WordPress武汉seo价格
  • 使用cn域名做网站的多吗sq网站推广
  • 站点推广策略包括网站外链的优化方法
  • 高端网站制作重庆百度seo排名优化软件