728x90
๋ฐ˜์‘ํ˜•

filter 2

[MSA ๊ตฌ์ถ•ํ•˜๊ธฐ] 8. Spring Cloud Gateway์— ํ•„ํ„ฐ ์ ์šฉํ•˜๊ธฐ (API Gateway)

๐Ÿ”Š ์šฐ๋ฆฌ๋Š” Spring Cloud๋ฅผ ํ™œ์šฉํ•˜์—ฌ MSA๋ฅผ ๊ตฌ์ถ•ํ•œ๋‹ค. ๐Ÿ”Š ์ด๋ฒˆ์—๋Š”, Spring Cloud Gateway Routes์˜ Filters๋ฅผ ์„ค์ •ํ•  ๊ฒƒ์ด๋‹ค. API Gateway ํŒŒํŠธ 4 https://bu119.tistory.com/94 [MSA ๊ตฌ์ถ•ํ•˜๊ธฐ] 6. Spring Cloud Gateway ๋ผ์šฐํŒ… ์„ค์ •ํ•˜๊ธฐ (API Gateway) ๐Ÿ”Š ์šฐ๋ฆฌ๋Š” Spring Cloud๋ฅผ ํ™œ์šฉํ•˜์—ฌ MSA๋ฅผ ๊ตฌ์ถ•ํ•œ๋‹ค. ๐Ÿ”Š ์ด๋ฒˆ์—๋Š”, API Gateway์˜ ๋ผ์šฐํŒ…์„ ์„ค์ •ํ•  ๊ฒƒ์ด๋‹ค. API Gateway ํŒŒํŠธ 2 ๋งˆ์ดํฌ๋กœ์„œ๋น„์Šค ์„œ๋ฒ„๋ฅผ 2๊ฐœ ์ด์ƒ ์ค€๋น„ํ•˜์ž. ๋ผ์šฐํŒ…์„ ์„ค์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์—๋Š” 3๊ฐ€ bu119.tistory.com Spring Cloud Gateway ๋ผ์šฐํŒ…์„ ์„ค์ •ํ–ˆ์ง€๋งŒ ์„œ๋ฒ„๋ฅผ ์‹คํ–‰ํ–ˆ์„ ๋•Œ ์ œ๋Œ€๋กœ ์—ฐ๊ฒฐ๋˜์ง€ ์•Š์•˜๋‹ค..

[MSA ๊ตฌ์ถ•ํ•˜๊ธฐ] 7. Spring Cloud Gateway๋ฅผ ํ™œ์šฉํ•œ ๊ฒฝ๋กœ ์ˆ˜์ • (API Gateway)

๐Ÿ”Š ์šฐ๋ฆฌ๋Š” Spring Cloud๋ฅผ ํ™œ์šฉํ•˜์—ฌ MSA๋ฅผ ๊ตฌ์ถ•ํ•œ๋‹ค. ๐Ÿ”Š ์•ž์„œ, API Gateway์˜ ๋ผ์šฐํŒ…์„ ์„ค์ •ํ–ˆ๋Š”๋ฐ ์‹คํ–‰ํ–ˆ์„ ๋•Œ ๊ฒฐ๊ณผ ๊ฐ’์ด ๋‹ค๋ฅด๊ฒŒ ๋‚˜ํƒ€๋‚ฌ๋‹ค. ๊ทธ ์ด์œ ์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์ž. API Gateway ํŒŒํŠธ 3 ์šฐ์„ , ์ž‘์„ฑํ•œ ์ฝ”๋“œ๋ฅผ ์‚ดํŽด๋ณด์ž. 1. user-service์˜ UserController.java ํŒŒ์ผ // user-service: UserController.java (8081 ํฌํŠธ ์‚ฌ์šฉ) package com.caffeinedoctor.userservice.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestControll..

728x90
๋ฐ˜์‘ํ˜•