전체 글
-
Spring WebSocket 활용프로젝트/WebSocket 2023. 6. 12. 00:01
개요 - WebSocket connect, disconnect시 클라이언트에게 알리기 - 서버에서 클라이언트에 disconnect 요청 보내기 - 개발테스트를 위한 http로 메시지 발송 개발자도구와 SocketJS http://host:port/myApp/myEndpoint/{server-id}/{session-id}/{transport} 소켓을 연결하면 다음과 같은 url로 연동됩니다. server-id는 클러스터 환경에서 요청을 라우팅 하기 위해 사용 session_id는 SockJS 세션에 속하는 HTTP 요청을 연관시킴 transport는 전송 타입을 가리킴 (websocket, xhr-streaming, xhr-polling) 예를들어 제가한 튜토리얼의 개발자도구 -> Network -> ws..
-
Spring Websocket 이론과 간단한 구현프로젝트/WebSocket 2023. 6. 11. 00:01
개요 https://spring.io/guides/gs/messaging-stomp-websocket/ Spring | Home Cloud Your code, any cloud—we’ve got you covered. Connect and scale your services, whatever your platform. spring.io QR 로그인을 구현하기 전, 브라우저와 서버 간 메시지를 주고받는 웹소켓의 Hello, World 애플리케이션을 만드는 과정을 수행해 봅니다. 웹소켓은 TCP 위에 있는 가벼운 계층이며 WebSocket 위에서 동작하는 STOMP라는 프로토콜을 활용합니다. WebSocket이란? HTTP프로토콜과 호환되며, 실시간 양뱡향 통신을 제공하기 위한 프로토콜입니다. 웹 초창기의..
-
1장 - 단위 테스트의 목표테스트코드(Test Code)/단위테스트 - 생산성과품질을위한 단위테스트원칙과패턴 2023. 6. 10. 00:01
테스트를 작성하는 노력은 줄이고, 그에 따르는 이득은 극대화해야 한다. 단위 테스트의 현황 대부분의 프로그래머는 단위 테스트를 실천하고 중요성을 알고 있다. 그냥 쓰고 버리는 프로젝트가 아니면, 단위 테스트는 늘 적용해야 한다. 요새의 논쟁은 바뀌고 있다, 단위 테스트를 작성해야 하는가? -> 좋은 단위 테스트를 작성하는 것은 어떤 의미인가? 좋은 테스트와 좋지 않은 테스트의 차이는 취향이나 개인적인 선호도의 문제가 아닌 프로젝트의 성패를 가르는 문제다. 이 책은 테스트 작성 노력 대비 최대의 이익을 이끌어 내는 방법으로 안내한다. 단위 테스트의 목표 흔히 단위 테스트 활동이 더 나은 설계로 이어진다고 한다. 하지만 이는 단위 테스트의 주목표는 아니다. 단위 테스트의 목표는 소프트웨어 프로젝트의 성장을 ..
-
RedisTemplate으로 Set 자료구조 사용하기프로젝트/선착순 쿠폰 발급 시스템 2023. 6. 9. 00:01
개요 선착순 쿠폰 발급을 위해 이벤트 쿠폰을 Set에 저장하고 사용자에게 발급할 때는 pop 하여서 발급해 주자 RedisTemplate 등록 @Bean fun redisTemplate(): RedisTemplate { val objectMapper = ObjectMapper() objectMapper.registerModule(JavaTimeModule()) // Java 8 시간 타입 처리 모듈 등록 objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) // 날짜 포맷 설정 val serializer = Jackson2JsonRedisSerializer(CouponRedisEntity::class.java) serializer.se..
-
Spring Cloud AWS 3.0 사용하기 - SNS, SQSAWS 2023. 6. 8. 00:01
개요 AWS는 Amazon Web Server를 잘 이용할 수 있도록 Java SDK를 제공합니다. Java SDK는 AWS에서 사용할 수 있는 모든 기능을 제공하지만, 이를 Spring 관용적 방식으로 사용하려면 상당한 양의 로우레벨 코드가 필요합니다. Spring Cloud AWS는 애플리케이션 개발자가 가장 많이 사용되는 AWS 서비스를 사용하고 로우레벨 코드를 최대한 피할 수 있도록 이미 통합된 Spring 기반 모듈을 제공합니다. Spring Cloud AWS BOM 사용하기 dependencies { //Spring Cloud AWS를 위한 의존성 //https://docs.awspring.io/spring-cloud-aws/docs/3.0.0/reference/html/index.html i..
-
Spring Boot 2 to Spring Boot 3 마이그레이션Spring Framework 2023. 6. 7. 00:01
개요 spring boot 2.6.2 버전을 spring boot 3.0.6으로 마이그레이션 하며 스프링부트 2와 3의 차이점을 알아보고자 합니다. Spring Boot 2.7로 마이그레이션 우선 Spring Boot 2의 가장 최신버전으로 마이그레이션을 하고, 최대한 @Deprecated된것을 제거하는 것이 좋습니다. @Deprecated된 것 중 아예 제거된 것이 있을 수 있으며 원활하게 Spring Boot 3로 넘어갈 수 있습니다. JDK Version 스프링 부트3 에서는 JDK 17 미만의 버전을 지원하지 않습니다. 패키지 이름 변경(javax -> jakarta) javax.persistence.* ➔ jakarta.persistence.* javax.validation.* ➔ jakarta..
-
Rest API로 Apple 로그인을 구현프로젝트/WebRTC 화상통화 프로젝트 2023. 6. 6. 00:01
[1] Sign In with Apple REST API 문서 정리 [2] Rest API로 Apple 로그인 구현 프런트엔드에서 사용자의 Apple 로그인 수행 후 code 받아오기 https://developer.apple.com/documentation/sign_in_with_apple/request_an_authorization_to_the_sign_in_with_apple_server Request an authorization to the Sign in with Apple server | Apple Developer Documentation Add a Sign in with Apple authorization flow to apps and web services that can’t direct..
-
[AWS] sns, sqs aws와 연동해보기AWS 2023. 6. 5. 00:01
개요 local이 아니라 dev환경에서 직접 aws sns, aws sqs와 연동해 보기 AwsSqsConfig @Configuration @Profile(value = ["dev"]) class AwsSqsConfig { @Bean @Primary fun amazonSQSAsync(): AmazonSQSBufferedAsyncClient { val amazonSQSAsync = AmazonSQSAsyncClientBuilder .standard() .withRegion(Regions.AP_NORTHEAST_2) .build() return AmazonSQSBufferedAsyncClient(amazonSQSAsync) } } dev용으로 amazonSQSConfig를 만들어주었습니다. AwsSnsCon..