热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

谷歌云SpringBootSpringCloud

BuildingScalableJavaMicroserviceswithSpringBootandSpringCloud学习笔记Week1GCPservicesoverviewS

Building Scalable Java Microservices with Spring Boot and Spring Cloud学习笔记

  • Week 1
    • GCP services overview
    • Spring Framework Intro
  • Week 2
    • Lab 1: Bootstrapping the application frontend and backend
  • Spring Boot注解


Week 1

GCP services overview

在这里插入图片描述

  • Cloud Function: provide a completely serverless execution environment or functions as a service
  • App engine: that provides a fully managed platform as a service framework.
  • Kubernetes engine: that provides a managed containers as a service environment for containerized applications.
  • Compute Engine: which is Google’s infrastructure as a service solution that provides maximum flexibility for users and organizations who choose to manage their solutions themselves.
    在这里插入图片描述
    Migrate from using a Cloud SQL instance to a Cloud Spanner instance to meet the needs for high levels of transactional performance.
    在这里插入图片描述

Spring Framework Intro

Spring framework: an open source application framework and inversion of control container developed by Pivotal for the Java platform.
Spring boot: a spring framework solution designed to simplify the bootstrapping and development of stand-alone production spring based applications.

Week 2

Lab 1: Bootstrapping the application frontend and backend

Cloudshell is an interactive Linux command line shell environment for managing resources hosted on GCP. When you start Cloudshell, it provisions a small compute engine virtual machine, running a Debian-based Linux operating system. Cloud Shell provides command line access to the virtual machine instance in a terminal window that opens in the GCP console.
Lab Link

Objectives
In this lab, you learn how to perform the following tasks:

  • Configure Cloud Shell to run a multi-part Java application locally
  • Use Apache Maven to launch Java applications in Cloud Shell
  • Use curl and the Cloud Shell web preview to test connectivity to web applications running locally in Cloud Shell

Task 1. Bootstrap the application

  1. Run the backend locally
    Run the backend application (guestbook-service).

cd ~/guestbook-service
./mvnw -q spring-boot:run -Dserver.port=8081

Test the service

curl http://localhost:8081/guestbookMessages

Post a new message.

curl -XPOST -H "content-type: application/json" \-d '{"name": "Ray", "message": "Hello"}' \http://localhost:8081/guestbookMessages

List all the messages.

curl http://localhost:8081/guestbookMessages

  1. Run the frontend locally
    Make a copy of the initial version of the frontend application (guestbook-frontend).

cp -a ~/spring-cloud-gcp-guestbook/1-bootstrap/guestbook-frontend \~/guestbook-frontend

Run the frontend application.

cd ~/guestbook-frontend
./mvnw -q spring-boot:run

Task 2. Test the guestbook application

  1. Web preview on port 8080

  2. Use Cloud Shell to test the backend service
    List all the calls to backend guestbook-service API

curl -s http://localhost:8081/guestbookMessages

  1. Use jp to parse the JSON return text in given format.

curl -s http://localhost:8081/guestbookMessages \| jq -r '._embedded.guestbookMessages[] | {name: .name, message: .message}'

Spring Boot注解

SpringBoot之常用注解


推荐阅读
  • 云原生边缘计算之KubeEdge简介及功能特点
    本文介绍了云原生边缘计算中的KubeEdge系统,该系统是一个开源系统,用于将容器化应用程序编排功能扩展到Edge的主机。它基于Kubernetes构建,并为网络应用程序提供基础架构支持。同时,KubeEdge具有离线模式、基于Kubernetes的节点、群集、应用程序和设备管理、资源优化等特点。此外,KubeEdge还支持跨平台工作,在私有、公共和混合云中都可以运行。同时,KubeEdge还提供数据管理和数据分析管道引擎的支持。最后,本文还介绍了KubeEdge系统生成证书的方法。 ... [详细]
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • 拥抱Android Design Support Library新变化(导航视图、悬浮ActionBar)
    转载请注明明桑AndroidAndroid5.0Loollipop作为Android最重要的版本之一,为我们带来了全新的界面风格和设计语言。看起来很受欢迎࿰ ... [详细]
  • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
    本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
  • Imtryingtofigureoutawaytogeneratetorrentfilesfromabucket,usingtheAWSSDKforGo.我正 ... [详细]
  • Android系统源码分析Zygote和SystemServer启动过程详解
    本文详细解析了Android系统源码中Zygote和SystemServer的启动过程。首先介绍了系统framework层启动的内容,帮助理解四大组件的启动和管理过程。接着介绍了AMS、PMS等系统服务的作用和调用方式。然后详细分析了Zygote的启动过程,解释了Zygote在Android启动过程中的决定作用。最后通过时序图展示了整个过程。 ... [详细]
  • Java 11相对于Java 8,OptaPlanner性能提升有多大?
    本文通过基准测试比较了Java 11和Java 8对OptaPlanner的性能提升。测试结果表明,在相同的硬件环境下,Java 11相对于Java 8在垃圾回收方面表现更好,从而提升了OptaPlanner的性能。 ... [详细]
  • 本文整理了Java中org.gwtbootstrap3.client.ui.Icon.addDomHandler()方法的一些代码示例,展示了Icon.ad ... [详细]
  • 在Docker中,将主机目录挂载到容器中作为volume使用时,常常会遇到文件权限问题。这是因为容器内外的UID不同所导致的。本文介绍了解决这个问题的方法,包括使用gosu和suexec工具以及在Dockerfile中配置volume的权限。通过这些方法,可以避免在使用Docker时出现无写权限的情况。 ... [详细]
  • HDU 2372 El Dorado(DP)的最长上升子序列长度求解方法
    本文介绍了解决HDU 2372 El Dorado问题的一种动态规划方法,通过循环k的方式求解最长上升子序列的长度。具体实现过程包括初始化dp数组、读取数列、计算最长上升子序列长度等步骤。 ... [详细]
  • 如何使用Java获取服务器硬件信息和磁盘负载率
    本文介绍了使用Java编程语言获取服务器硬件信息和磁盘负载率的方法。首先在远程服务器上搭建一个支持服务端语言的HTTP服务,并获取服务器的磁盘信息,并将结果输出。然后在本地使用JS编写一个AJAX脚本,远程请求服务端的程序,得到结果并展示给用户。其中还介绍了如何提取硬盘序列号的方法。 ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • Netty源代码分析服务器端启动ServerBootstrap初始化
    本文主要分析了Netty源代码中服务器端启动的过程,包括ServerBootstrap的初始化和相关参数的设置。通过分析NioEventLoopGroup、NioServerSocketChannel、ChannelOption.SO_BACKLOG等关键组件和选项的作用,深入理解Netty服务器端的启动过程。同时,还介绍了LoggingHandler的作用和使用方法,帮助读者更好地理解Netty源代码。 ... [详细]
  • 1.脚本功能1)自动替换jar包中的配置文件。2)自动备份老版本的Jar包3)自动判断是初次启动还是更新服务2.脚本准备进入ho ... [详细]
author-avatar
凉情__凉心凉少年11
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有