关于spring-cloud-kubernetes

spring-cloud-kubernetes是springcloud官方推出的开源项目,用于将Spring Cloud和Spring Boot应用运行在kubernetes环境,并且提供了通用的接口来调用kubernetes服务,GitHub上官方地址是:https://github.com/spring-cloud/spring-cloud-kubernetes

该项目的提交者之一,就是SpringCloud的作者之一Spencer Gibb:

系列文章列表

本文是《spring-cloud-kubernetes实战系列》的第二篇,全文链接如下:

  1. 《spring-cloud-kubernetes官方demo运行实战》
  2. 《你好spring-cloud-kubernetes》
  3. 《spring-cloud-kubernetes背后的三个关键知识点》
  4. 《spring-cloud-kubernetes的服务发现和轮询实战(含熔断)》
  5. 《spring-cloud-kubernetes与SpringCloud Gateway》
  6. 《spring-cloud-kubernetes与k8s的configmap》

通过官方demo来了解spring-cloud-kubernetes

spring-cloud-kubernetes项目也提供了丰富的官方demo来帮助开发者了解和学习spring-cloud-kubernetes,您可以参考《spring-cloud-kubernetes官方demo运行实战》快速体验官方demo;

实战spring-cloud-kubernetes

今天实战的内容是开发一个简单的java应用,然后将其部署在kubernetes环境(minikube 1.1.1),该应用通过spring-cloud-kubernetes调用当前kubernetes的服务;

环境信息

本次实战的环境和版本信息如下:

  1. 操作系统:CentOS Linux release 7.6.1810
  2. minikube:1.1.1
  3. Java:1.8.0_191
  4. Maven:3.6.0
  5. fabric8-maven-plugin插件:3.5.37
  6. spring-cloud-kubernetes:1.0.1.RELEASE

上面的linux、minikube、java、maven,请确保已准备好,linux环境下minikube的安装和启动请参考《Linux安装minikube指南 》

准备工作已经OK,开始编码吧。

源码下载

如果您不打算写代码,也可以从GitHub上下载本次实战的源码,地址和链接信息如下表所示:

名称 链接 备注
项目主页 https://github.com/zq2599/blog_demos 该项目在GitHub上的主页
git仓库地址(https) https://github.com/zq2599/blog_demos.git 该项目源码的仓库地址,https协议
git仓库地址(ssh) git@github.com:zq2599/blog_demos.git 该项目源码的仓库地址,ssh协议


这个git项目中有多个文件夹,本章源码在springcloudk8sdiscovery这个文件夹下,如下图红框所示:

开发应用

  1. 基于maven创建一个springboot应用,名为springcloudk8sdiscovery;
  2. 该应用完整的pom.xml内容如下:
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4. <modelVersion>4.0.0</modelVersion>
  5. <parent>
  6. <groupId>org.springframework.boot</groupId>
  7. <artifactId>spring-boot-starter-parent</artifactId>
  8. <version>2.1.1.RELEASE</version>
  9. <relativePath/> <!-- lookup parent from repository -->
  10. </parent>
  11. <groupId>com.bolingcavalry</groupId>
  12. <artifactId>springcloudk8sdiscovery</artifactId>
  13. <version>0.0.1-SNAPSHOT</version>
  14. <name>springcloudk8sdiscovery</name>
  15. <description>Demo project for Spring Boot</description>
  16. <properties>
  17. <java.version>1.8</java.version>
  18. <spring-boot.version>2.1.1.RELEASE</spring-boot.version>
  19. <maven-compiler-plugin.version>3.5</maven-compiler-plugin.version>
  20. <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
  21. <maven-failsafe-plugin.version>2.18.1</maven-failsafe-plugin.version>
  22. <maven-surefire-plugin.version>2.21.0</maven-surefire-plugin.version>
  23. <fabric8.maven.plugin.version>3.5.37</fabric8.maven.plugin.version>
  24. </properties>
  25. <dependencyManagement>
  26. <dependencies>
  27. <dependency>
  28. <groupId>org.springframework.boot</groupId>
  29. <artifactId>spring-boot-dependencies</artifactId>
  30. <type>pom</type>
  31. <scope>import</scope>
  32. <version>${spring-boot.version}</version>
  33. </dependency>
  34. </dependencies>
  35. </dependencyManagement>
  36. <dependencies>
  37. <dependency>
  38. <groupId>org.springframework.cloud</groupId>
  39. <artifactId>spring-cloud-kubernetes-core</artifactId>
  40. <version>1.0.1.RELEASE</version>
  41. </dependency>
  42. <dependency>
  43. <groupId>org.springframework.cloud</groupId>
  44. <artifactId>spring-cloud-kubernetes-discovery</artifactId>
  45. <version>1.0.1.RELEASE</version>
  46. </dependency>
  47. <dependency>
  48. <groupId>org.springframework.cloud</groupId>
  49. <artifactId>spring-cloud-commons</artifactId>
  50. <version>2.1.1.RELEASE</version>
  51. </dependency>
  52. <dependency>
  53. <groupId>org.springframework.boot</groupId>
  54. <artifactId>spring-boot-starter</artifactId>
  55. <version>2.1.1.RELEASE</version>
  56. </dependency>
  57. <dependency>
  58. <groupId>org.springframework.boot</groupId>
  59. <artifactId>spring-boot-starter-web</artifactId>
  60. <version>2.1.1.RELEASE</version>
  61. </dependency>
  62. <!--
  63. We need that(actuator) so that it can be used in readiness probes.
  64. Readiness checks are needed by arquillian, so that it
  65. knows when to run the actual test.
  66. -->
  67. <dependency>
  68. <groupId>org.springframework.boot</groupId>
  69. <artifactId>spring-boot-starter-actuator</artifactId>
  70. <version>2.1.1.RELEASE</version>
  71. </dependency>
  72. <dependency>
  73. <groupId>com.alibaba</groupId>
  74. <artifactId>fastjson</artifactId>
  75. <version>1.2.28</version>
  76. </dependency>
  77. </dependencies>
  78. <build>
  79. <plugins>
  80. <plugin>
  81. <groupId>org.springframework.boot</groupId>
  82. <artifactId>spring-boot-maven-plugin</artifactId>
  83. <version>${spring-boot.version}</version>
  84. <executions>
  85. <execution>
  86. <goals>
  87. <goal>repackage</goal>
  88. </goals>
  89. </execution>
  90. </executions>
  91. </plugin>
  92. <plugin>
  93. <!--skip deploy -->
  94. <groupId>org.apache.maven.plugins</groupId>
  95. <artifactId>maven-deploy-plugin</artifactId>
  96. <version>${maven-deploy-plugin.version}</version>
  97. <configuration>
  98. <skip>true</skip>
  99. </configuration>
  100. </plugin>
  101. <plugin>
  102. <groupId>org.apache.maven.plugins</groupId>
  103. <artifactId>maven-surefire-plugin</artifactId>
  104. <version>${maven-surefire-plugin.version}</version>
  105. <configuration>
  106. <skipTests>true</skipTests>
  107. <!-- Workaround for https://issues.apache.org/jira/browse/SUREFIRE-1588 -->
  108. <useSystemClassLoader>false</useSystemClassLoader>
  109. </configuration>
  110. </plugin>
  111. <plugin>
  112. <groupId>io.fabric8</groupId>
  113. <artifactId>fabric8-maven-plugin</artifactId>
  114. <version>${fabric8.maven.plugin.version}</version>
  115. <executions>
  116. <execution>
  117. <id>fmp</id>
  118. <goals>
  119. <goal>resource</goal>
  120. </goals>
  121. </execution>
  122. </executions>
  123. </plugin>
  124. </plugins>
  125. </build>
  126. <profiles>
  127. <profile>
  128. <id>kubernetes</id>
  129. <build>
  130. <plugins>
  131. <plugin>
  132. <groupId>io.fabric8</groupId>
  133. <artifactId>fabric8-maven-plugin</artifactId>
  134. <version>${fabric8.maven.plugin.version}</version>
  135. <executions>
  136. <execution>
  137. <id>fmp</id>
  138. <goals>
  139. <goal>resource</goal>
  140. <goal>build</goal>
  141. </goals>
  142. </execution>
  143. </executions>
  144. <configuration>
  145. <enricher>
  146. <config>
  147. <fmp-service>
  148. <type>NodePort</type>
  149. </fmp-service>
  150. </config>
  151. </enricher>
  152. </configuration>
  153. </plugin>
  154. </plugins>
  155. </build>
  156. </profile>
  157. <profile>
  158. <id>release</id>
  159. <build>
  160. <plugins>
  161. <plugin>
  162. <groupId>io.fabric8</groupId>
  163. <artifactId>fabric8-maven-plugin</artifactId>
  164. <version>${fabric8.maven.plugin.version}</version>
  165. <executions>
  166. <execution>
  167. <id>fmp</id>
  168. <goals>
  169. <goal>resource</goal>
  170. <goal>helm</goal>
  171. </goals>
  172. </execution>
  173. </executions>
  174. </plugin>
  175. </plugins>
  176. </build>
  177. </profile>
  178. <profile>
  179. <id>integration</id>
  180. <build>
  181. <plugins>
  182. <plugin>
  183. <groupId>io.fabric8</groupId>
  184. <artifactId>fabric8-maven-plugin</artifactId>
  185. <version>${fabric8.maven.plugin.version}</version>
  186. <executions>
  187. <execution>
  188. <id>fmp</id>
  189. <goals>
  190. <goal>resource</goal>
  191. <goal>build</goal>
  192. </goals>
  193. </execution>
  194. </executions>
  195. </plugin>
  196. <plugin>
  197. <groupId>org.apache.maven.plugins</groupId>
  198. <artifactId>maven-failsafe-plugin</artifactId>
  199. <version>${maven-failsafe-plugin.version}</version>
  200. <executions>
  201. <execution>
  202. <id>run-integration-tests</id>
  203. <phase>integration-test</phase>
  204. <goals>
  205. <goal>integration-test</goal>
  206. <goal>verify</goal>
  207. </goals>
  208. </execution>
  209. </executions>
  210. <configuration>
  211. <skipTests>false</skipTests>
  212. <skipITs>false</skipITs>
  213. </configuration>
  214. </plugin>
  215. </plugins>
  216. </build>
  217. </profile>
  218. </profiles>
  219. </project>

上述pom.xml文件有几处需要关注:

a. 直接依赖了spring-cloud-kubernetes的以下两个库,后面才能使用spring-cloud-kubernetes的服务:

  1. org.springframework.cloud:spring-cloud-kubernetes-core:1.0.1.RELEASE
  2. org.springframework.cloud:spring-cloud-kubernetes-discovery:1.0.1.RELEASE

b. 使用插件fabric8-maven-plugin来构建镜像并部署到minikube环境:

  1. <plugin>
  2. <groupId>io.fabric8</groupId>
  3. <artifactId>fabric8-maven-plugin</artifactId>
  4. <version>${fabric8.maven.plugin.version}</version>
  5. <executions>
  6. <execution>
  7. <id>fmp</id>
  8. <goals>
  9. <goal>resource</goal>
  10. </goals>
  11. </execution>
  12. </executions>
  13. </plugin>

c. 为fabric8-maven-plugin插件准备了三个profile,本次实战主要用到kubernetes这个:

  1. <profile>
  2. <id>kubernetes</id>
  3. <build>
  4. <plugins>
  5. <plugin>
  6. <groupId>io.fabric8</groupId>
  7. <artifactId>fabric8-maven-plugin</artifactId>
  8. <version>${fabric8.maven.plugin.version}</version>
  9. <executions>
  10. <execution>
  11. <id>fmp</id>
  12. <goals>
  13. <goal>resource</goal>
  14. <goal>build</goal>
  15. </goals>
  16. </execution>
  17. </executions>
  18. <configuration>
  19. <enricher>
  20. <config>
  21. <fmp-service>
  22. <!--部署到kubernetes后,会创建一个类型为NodePort的service-->
  23. <type>NodePort</type>
  24. </fmp-service>
  25. </config>
  26. </enricher>
  27. </configuration>
  28. </plugin>
  29. </plugins>
  30. </build>
  31. </profile>

以上就是pom.xml的内容了,主要是添加spring-cloud-kubernetes的依赖,以及使用fabric8来构建和部署;

  1. 在application.properties文件中设置应用名称:
  1. spring.application.name=springcloudk8sdiscovery
  1. 创建应用启动类Springcloudk8sdiscoveryApplication,可见这是个很普通的springboot启动类:
  1. package com.bolingcavalry.springcloudk8sdiscovery;
  2. import org.springframework.boot.SpringApplication;
  3. import org.springframework.boot.autoconfigure.SpringBootApplication;
  4. import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
  5. @SpringBootApplication
  6. @EnableDiscoveryClient
  7. public class Springcloudk8sdiscoveryApplication {
  8. public static void main(String[] args) {
  9. SpringApplication.run(Springcloudk8sdiscoveryApplication.class, args);
  10. }
  11. }
  1. 创建controller类,对外提供http服务,部署完成后通过这些http服务来验证功能:
  1. @RestController
  2. public class DiscoveryController {
  3. @Autowired
  4. private DiscoveryClient discoveryClient;
  5. /**
  6. * 探针检查响应类
  7. * @return
  8. */
  9. @RequestMapping("/health")
  10. public String health() {
  11. return "health";
  12. }
  13. /**
  14. * 返回远程调用的结果
  15. * @return
  16. */
  17. @RequestMapping("/getservicedetail")
  18. public String getservicedetail(
  19. @RequestParam(value = "servicename", defaultValue = "") String servicename) {
  20. return "Service [" + servicename + "]'s instance list : " + JSON.toJSONString(discoveryClient.getInstances(servicename));
  21. }
  22. /**
  23. * 返回发现的所有服务
  24. * @return
  25. */
  26. @RequestMapping("/services")
  27. public String services() {
  28. return this.discoveryClient.getServices().toString()
  29. + ", "
  30. + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
  31. }
  32. }

上述代码有几点需要注意:

a. health方法用于响应kubernetes的探针检查;

b. getservicedetail方法接收名为servicename的参数,然后去服务列表中检查对应的服务对象并返回;

c. services方法返回的是所有服务的名称;

以上就是所有代码了,功能是通过autowire得到DiscoveryClient实例,再调用该实例的API取得服务信息。

接下来我们将应用构建并部署到minikube环境;

编译构建

  1. 请确保当前电脑上java、maven、minikube都是正常的;
  2. 在pom.xml文件所在目录执行以下命令,即可编译构建部署一次性完成:
  1. mvn clean package fabric8:deploy -Pkubernetes

构建成功后,控制台输出信息如下:

  1. ...
  2. [INFO]
  3. [INFO] <<< fabric8-maven-plugin:3.5.37:deploy (default-cli) < install @ springcloudk8sdiscovery <<<
  4. [INFO]
  5. [INFO]
  6. [INFO] --- fabric8-maven-plugin:3.5.37:deploy (default-cli) @ springcloudk8sdiscovery ---
  7. [INFO] F8: Using Kubernetes at https://192.168.121.133:8443/ in namespace default with manifest /usr/local/work/demo/springcloudk8sdiscovery/target/classes/META-INF/fabric8/kubernetes.yml
  8. [INFO] Using namespace: default
  9. [INFO] Updating a Service from kubernetes.yml
  10. [INFO] Updated Service: target/fabric8/applyJson/default/service-springcloudk8sdiscovery.json
  11. [INFO] Using namespace: default
  12. [INFO] Updating Deployment from kubernetes.yml
  13. [INFO] Updated Deployment: target/fabric8/applyJson/default/deployment-springcloudk8sdiscovery.json
  14. [INFO] F8: HINT: Use the command `kubectl get pods -w` to watch your pods start up
  15. [INFO] ------------------------------------------------------------------------
  16. [INFO] BUILD SUCCESS
  17. [INFO] ------------------------------------------------------------------------
  18. [INFO] Total time: 11.207 s
  19. [INFO] Finished at: 2019-06-09T18:50:09+08:00
  20. [INFO] ------------------------------------------------------------------------
  1. 用kubectl命令查看部署和服务,都处于正常状态:
  1. [root@minikube springcloudk8sdiscovery]# kubectl get deployments
  2. NAME READY UP-TO-DATE AVAILABLE AGE
  3. springcloudk8sdiscovery 1/1 1 1 75m
  4. [root@minikube springcloudk8sdiscovery]# kubectl get svc
  5. NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
  6. kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 33h
  7. springcloudk8sdiscovery NodePort 10.102.167.79 <none> 8080:31583/TCP 75m
  1. 执行命令minikube service springcloudk8sdiscovery --url,得到的是可以从外部访问的服务地址:http://192.168.121.133:31583 ,其中192.168.121.133是宿主机IP地址;
  2. 在浏览器上访问地址http://192.168.121.133:31583/services ,如下图,返回的"所有服务"其实是kubernetes中的所有service:

  3. 为了验证当前namespace下的所有服务都能被发现,我们再创建个服务实施,执行以下命令,会创建名为my-tomcat的部署和服务:
  1. kubectl run my-tomcat --image=tomcat:7.0.94-jre7-alpine --replicas=2 --port=8080 \
  2. && kubectl expose deployment my-tomcat --port=8080 --target-port=8080 --external-ip=192.168.50.7 --type=LoadBalancer

由于下载镜像需要一定时间,所以需要稍作等待;

7. 再去访问地址http://192.168.121.133:31583/services ,如下图,my-tomcat赫然在列:



8. 访问地址http://192.168.121.133:31583/getservicedetail?servicename=my-tomcat ,会得到名为my-tomcat的服务信息,该信息格式化后的内容如下所示:

  1. [
  2. {
  3. "host": "172.17.0.4",
  4. "instanceId": "91201db9-8aa6-11e9-a5b5-000c29fd2001",
  5. "metadata": {
  6. "run": "my-tomcat"
  7. },
  8. "port": 8080,
  9. "scheme": "http://",
  10. "secure": false,
  11. "serviceId": "my-tomcat",
  12. "uri": "http://172.17.0.4:8080"
  13. },
  14. {
  15. "host": "172.17.0.5",
  16. "instanceId": "91223cda-8aa6-11e9-a5b5-000c29fd2001",
  17. "metadata": {
  18. "$ref": "$[0].metadata"
  19. },
  20. "port": 8080,
  21. "scheme": "http://",
  22. "secure": false,
  23. "serviceId": "my-tomcat",
  24. "uri": "http://172.17.0.5:8080"
  25. }
  26. ]

可见spring-cloud-kubernetes的DiscoveryClient服务将kubernetes中的"service"资源与SpringCloud中的服务对应起来了,有了这个DiscoveryClient,我们在kubernetes环境就不需要eureka来做注册发现了,而是直接使用kubernetes的服务机制,此时不得不感慨SpringCloud的对DiscoveryClient的设计是如此的精妙。

至此,spring-cloud-kubernetes的初体验就结束了,通过简单的编码我们的程序在kubernetes环境可以取得service资源的信息,随着学习的深入,我们会用到更多的spring-cloud-kubernetes能力,感谢spring-cloud-kubernetes的设计者,让我们的SpringCloud应用畅游在在kubernetes世界。

疑惑待解

您可能会有些疑惑:上面的代码都是和SpringCloud相关的,和spring-cloud-kubernetes没什么关系呀,为什么程序运行起来后就能取得kubernetes环境中的服务信息呢?

此问题如果不弄清楚,后面的学习很难展开,因为我们都不知道自己的代码与kubernetes环境有什么关系,和kubernetes有没有交互?

以上问题,欢迎访问《spring-cloud-kubernetes背后的三个关键知识点》,这里面有详细的分析。

欢迎关注我的公众号

你好spring-cloud-kubernetes的更多相关文章

  1. 朱晔和你聊Spring系列S1E11:小测Spring Cloud Kubernetes @ 阿里云K8S

    有关Spring Cloud Kubernates(以下简称SCK)详见https://github.com/spring-cloud/spring-cloud-kubernetes,在本文中我们主要 ...

  2. Spring Cloud Config整合Spring Cloud Kubernetes,在k8s上管理配置

    1 前言 欢迎访问南瓜慢说 www.pkslow.com获取更多精彩文章! Kubernetes有专门的ConfigMap和Secret来管理配置,但它也有一些局限性,所以还是希望通过Spring C ...

  3. Springboot整合Spring Cloud Kubernetes读取ConfigMap,支持自动刷新配置

    1 前言 欢迎访问南瓜慢说 www.pkslow.com获取更多精彩文章! Docker & Kubernetes相关文章:容器技术 之前介绍了Spring Cloud Config的用法,但 ...

  4. spring cloud kubernetes之serviceaccount permisson报错

    spring boot项目引用spring-cloud-starter-kubernetes <dependency> <groupId>org.springframework ...

  5. Netflix OSS、Spring Cloud还是Kubernetes? 都要吧!

    Netflix OSS是由Netflix公司主持开发的一套代码框架和库,目的是解决上了规模之后的分布式系统可能出现的一些有趣问题.对于当今时代的Java开发者们来说,Netflix OSS简直就是在云 ...

  6. 【架构】Kubernetes和Spring Cloud哪个部署微服务更好?

    Spring Cloud 和Kubernetes都自称自己是部署和运行微服务的最好环境,但是它们在本质上和解决不同问题上是有很大差异的.在本文中,我们将看到每个平台如何帮助交付基于微服务的架构(MSA ...

  7. 微服务Spring Cloud与Kubernetes比较

    转 http://www.tuicool.com/articles/VnMf2y3 Spring Cloud或Kubernetes都宣称它们是开发运行微服务的最好环境,哪个更好?答案是两个都是,但他们 ...

  8. Spring Cloud 2020.0.0正式发布,再见了Netflix

    目录 ✍前言 版本约定 ✍正文 Spring Cloud版本管理 与Spring Boot版本对应关系 当前支持的版本 阻断式升级(不向下兼容) 1.再见了,Netflix Netflix组件替代方案 ...

  9. Spring Cloud Greenwich 正式发布,Hystrix 即将寿终正寝。。

    Spring Cloud Greenwich 正式版在 01/23/2019 这天正式发布了,下面我们来看下有哪些更新内容. 生命周期终止提醒 Spring Cloud Edgware Edgware ...

  10. Spring Cloud Hoxton正式发布,Spring Boot 2.2 不再孤单

    距离Spring Boot 2.2.0的发布已经有一个半月左右时间,由于与之匹配的Spring Cloud版本一直没有Release,所以在这期间碰到不少读者咨询的问题都是由于Spring Boot和 ...

随机推荐

  1. vue项目目录结构详解

    项目简介基于 vue.js 的前端开发环境,用于前后端分离后的单页应用开发,可以在开发时使用 ES Next.scss 等最新语言特性.项目包含: 基础库: vue.js.vue-router.vue ...

  2. vue.js主要内容

    vue的主要内容 1.了解vue 2.vue开发环境的搭建和脚手架工具的使用 3.vue具体的指令和项目实战 1.了解vue 1.具备基础:html.css.js,模块化概念.ES6语法(简单即可) ...

  3. UE4中UMG与C++交互 页面文本修改

    在UE4中,有两种方式创建ui,一种是使用slate的方式,一种是UMG,UMG是slate的封装,是一个可视化的ui编辑器.slate则是纯c++方式(之前实验过一次slate创建页面,代码相当麻烦 ...

  4. 使用JavaScript的XMLHttpRequest+fromdata 传递blob到后端

    需要上传网页录音文件到服务器,写的艰辛,终于好了,C#端的代码失败的留作纪念,JS端也有失败的案例,就不放上来了 JavaScript: var form = new FormData(); form ...

  5. Java匹马行天下之J2EE框架开发——Spring—>Spring框架知多少

    ————也许我注定成不了一个伟大的人,但是至少我可以做一个很棒的自己.我想我现在应该做的不是瞻前顾后,而是活在当下,正确认知自己,做好自己现在的工作,努力提升自己的能力,踏踏实实地做一个程序员 一.思 ...

  6. Usaco Training [2.1] The Castle 搜索

    传送门 题目的输出的4个信息 前两个很容易,dfs,bfs都可以,图怎么建都可以 后两个在搜索的时候记录belong[i][j]和已有的size即可 代码应该比不少题解清晰吧 #include < ...

  7. Canvas动画(PC端 移动端)

    Canvas动画(PC端 移动端) 一,介绍与需求 1.1,介绍 canvas是HTML5中新增一个HTML5标签与操作canvas的javascript API,它可以实现在网页中完成动态的2D与3 ...

  8. GooglePlay新版排行榜接入

    新版本的GMS的api和老版本的有很大的差异,刚接了一下,在这里留一个记号,以便查阅:判定是否已经登录 private static boolean isSignedIn(Cocos2dxActivi ...

  9. java订单生成工具类

    欢迎来到付宗乐个人博客网站.本个人博客网站提供最新的站长新闻,各种互联网资讯. 还提供个人博客模板,最新最全的java教程,java面试题.在此我将尽我最大所能将此个人博客网站做的最好! 谢谢大家,愿 ...

  10. gRPC的简单使用

    目录 前言 gRPC的简单介绍 基本用法 服务的定义 服务端代码编写 客户端代码编写 运行效果 服务治理(注册与发现) .NET Core 2.x 和 .NET Core 3.0的细微区别 扩展阅读 ...