Skip to Content
持續交付|使用Java
book

持續交付|使用Java

by Daniel Bryant, Abraham Marín-Pérez
July 2019
Intermediate to advanced
480 pages
9h 35m
Chinese
GoTop Information, Inc.
Content preview from 持續交付|使用Java
282
| 第十章
本節將介紹微服務與持續交付領域最常見的組態管理方式,並且指出各種方式的優
缺點。
Baked-In”組態
設置 app 最簡單的方式是將組態檔與 app 本身包在一塊,此外,你也可以把組態檔與程
式碼放在同一個存放區,以方便追蹤組態的變動。採取這種做法代表你不需要做任何特
殊的事情,就可以確保 app 在部署至生產環境時已被設置了,所以它是一種方便且吸引
人的選項。Extended Java Shop 的所有服務都使用 baked-in 組態,基於 Spring Boot 的服
務使用
applications.properties
檔,基於 Dropwizard 的服務(Product Catalogue 服務)使
product-catalogue.yml
乍看之下,使用這種 baked-in 設置方法時,你只能讓組態使用一組值,也就是說,你
不可能讓不同的環境使用不同的組態(例如測試與生產)。但是 baked-in 組態可以放入
多個選項或 profile,讓 app 根據環境的參數或變數來決定究竟要選擇哪一個。Feature
Flags 服務有一個這種範例,它使用 Spring Boot profile 概念來維護兩組組態值,這可
以用三個 baked-in 組態檔來實現:
application.properties
指定預設的 profile
application-test.properties
根據 test profile 指定組態值
application-pr
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

精實企業|高績效組織如何達成創新規模化

精實企業|高績效組織如何達成創新規模化

Jez Humble, Joanne Molesky, Barry O'Reilly
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey
精通機器學習|使用Python

精通機器學習|使用Python

Sarah Guido, Andreas C. Mueller
数字化转型:企业破局的34 个锦囊

数字化转型:企业破局的34 个锦囊

Gary O’Brien, Xiao Guo, Mike Mason

Publisher Resources

ISBN: 9789865021740