2017-01-01から1年間の記事一覧

Spring Boot Ribbon Sample

Spring Boot Ribbon Sample イメージ図 eureka server ,client(service discovery) を使ってport:8001, 8002のservice instanceを起動 上記で起動している2つをRibbonを使って、交互にcallしているのを試してみました。 同じURLで、使用しているbackendのサ…

Spring Boot Config Client for Server with vault backend

Spring Boot Config Serverでvaultの設定ファイルを取得し、そのserverに対して設定ファイルを取得しにいくclientのサンプルです。 イメージ図 vaultのtokenをbootstrap.ymlファイルに追加 spring: cloud: config: token: your-vault-token controllerクラス…

Spring Boot Config Server with vault backend

ローカル環境でvaultサーバを起動 昨日、試したので、 tomotaka.hatenablog.com Spring Boot Cloud Config Server コードは、gitにアップ github.comすごく簡単です。application.ymlの設定にvaultを追加するだけ(gitは、無効に) server: port: 8888 sprin…

HashiCorp Vault Server of dev

install 以下のページに記載しているようにしてインストール just follow the below guide https://www.vaultproject.io/intro/getting-started/install.html make directory to install vault server. serverをインストールするためにdirectoryを作成 mkdir…

Spring Boot Validation and to customize Error Message

Spring Boot で画面の入力チェックとエラーメッセージの表示を実装 Spring Boot Version 2.0.0.M7で実装してみました。 エラー時の画面サンプル Formクラスにチェックしたい制約アノテーションをつける @ NumberFormatで、フォーマットしてくれて便利 String…

Spring Boot Config Server Sample

Cloud Config Server Sample As of Spring Boot Version 2.0.0.M7(2017-12-22) Spring Boot Version 2.0.0.M7時点でのサンプル設定ファイル(ymlファイル)は、ローカルの以下の場所より取得 application.yml server: port: 8888 spring: cloud: config: serve…

Spring Boot Multiple yml with profiles

I just wanted to use multiple config(app-key.yml, app-api.yml) for each environment. 複数の設定ファイル(例:app-key.yml, app-api.yml)を各環境ごとで使用できるようにしています。each file has the below value 各ファイルの値は以下のようにして…

Spring Boot Multiple Application Runner

This is very simple example using Spring Boot with 2 stand alone application in 1 project.The point is you need Java config class and a class which implements ApplicationRunner Interface(or CommandLineRunner) for each job. And use @Conditi…