Preflight란브라우저가 실제 요청을 보내기 전, 서버에 “요청을 보내도 되는지” 물어보는 예비 요청이다.OPTIONS 메서드를 사용하며, 서버가 허용 응답을 줘야만 실제 데이터 요청이 진행된다. Spring Security 적용 이후 Preflight 에러 발생OPTIONS 요청에는 Header에 값을 붙여서 전달할 수 없다. 즉 Header에 JWT 토큰을 담을 수 없어, Spring Security에서 “인증되지 않은 요청”으로 401 에러를 반환했다. 이전에도 Spring Security를 사용했었는데, 해당 에러를 접한적이 없어서 Security 버전이 바뀜에 따라 변경된 것이 있는지 궁금했다. Security Filter Preflight 에러 해결Security 설정에 CORS를 등록하면..
해당 글은 아래 스프링 공식문서를 바탕으로 정리한 글입니다.https://spring.io/blog/2025/12/18/next-level-kotlin-support-in-spring-boot-4 Next level Kotlin support in Spring Boot 4Following the announcement of the strategic partnership between JetBrains and Spring in May, I would like to share a global update on various Kotlin-related features and documentation enhancements we have made recently, with the goal of making Sp..
Spring RestClient 설정, 구성 요소와 주요 옵션에 대해 정리한 글입니다.해당 글은 Apache HttpClient 5를 기반으로 하여 Timeout, Connection Pooling 에 대해 설명합니다.Dependencyimplementation("org.apache.httpcomponents.client5:httpclient5:5.5") RestClient.BuilderRestClient.Builder를 Bean으로 등록하여 애플리케이션 전반에서 공통된 설정을 가진 RestClient를 쉽게 생성해서 사용할 수 있습니다. Connection & Request Factory 생성HttpComponentsClientHttpRequestFactory를 생성하여 Spring RestClient..
목표jdbcTemplate.batchUpdate 를 이용해 batch upsert 처리하기각 데이터 타입(int, long, double, string, text[], jsonb) 안전하게 처리하기NULL 처리 대량의 데이터를 Insert/Update 해야 할 때 가장 많이 사용하는 방법 중 하나가 JdbcTemplate.batchUpdate() 이다.특히 PostgreSQL을 사용할 경우 UPSERT(ON CONFLICT … DO UPDATE) 기능과 함께 사용하면,대량 데이터 upsert 작업을 매우 효율적으로 처리할 수 있다. Spring Boot Bulk Insert 성능 비교 JPA vs JDBC 하지만 Spring에서 JbdcTemplate으로 batch 작업을 처리할 때 신경써야하는 부분이 ..