📌 참고사항openSearch : 3.6.0 버전springboot : 3.4.4 버전1. ProductSearchService@Service@RequiredArgsConstructorpublic class ProductSearchService { private static final String INDEX = "products"; private final OpenSearchClient openSearchClient; // 저장 public String save(ProductDocument product) throws IOException { IndexResponse response = openSearchClient.index(i -> i.index(INDEX).id(..
📌 참고사항openSearch : 3.6.0 버전springboot : 3.4.4 버전1. ProductDocument@Getter@Setter@NoArgsConstructor@AllArgsConstructor@Builderpublic class ProductDocument { private String id; private String name;} 1. OpenSearch 인덱스에 저장될 문서의 Java 데이터 구조2. OpenSearchClient를 통해 이 Document를 인덱싱하고 검색 2. StartupRunner@Component@RequiredArgsConstructorpublic class StartupRunner implements CommandLineRunner { ..
📌 참고사항openSearch : 3.6.0 버전springboot : 3.4.4 버전1. docker-compose.yml 설정services: opensearch: image: opensearchproject/opensearch:3.6.0 container_name: opensearch environment: - discovery.type=single-node - plugins.security.disabled=true - OPENSEARCH_INITIAL_ADMIN_PASSWORD=Opensearch@3600! - OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m ports: - "9200:9200" -..
📌 참고사항elasticsearch : 8.19.16 버전springboot : 3.4.4 버전1. ProductSearchService@Service@RequiredArgsConstructorpublic class ProductSearchService { private final ProductSearchRepository productSearchRepository; public void save(String keyword) { ProductDocument document = ProductDocument.builder() .id(UUID.randomUUID().toString()) .name(keyword) ..
📌 참고사항elasticsearch : 8.19.16 버전springboot : 3.4.4 버전1. ProductDocument@Getter@Setter@NoArgsConstructor@AllArgsConstructor@Builder@Document(indexName = "products")public class ProductDocument { @Id private String id; @Field(type = FieldType.Search_As_You_Type) private String name;} 1. Elasticsearch 인덱스에 저장될 데이터 구조2. FieldType.Search_As_You_Type은 "검색엔진" 이라는 단어를 검, 검색, 검색엔, 검색엔진 으로 토큰..
📌 참고사항elasticsearch : 8.19.16 버전springboot : 3.4.4 버전1. docker-compose.yml 설정services: elasticsearch: image: elasticsearch:8.19.16 container_name: elasticsearch environment: - discovery.type=single-node - xpack.security.enabled=false ports: - "9200:9200" - "9300:9300" volumes: - elastic_data:/usr/share/elasticsearch/data restart: unless-stopped kiban..
📌 참고사항사용DB : Oracle, Postgresql개발 환경 : Java, SpringBoot파일 서버 : NAS, S31. 계획1) NAS 서버에 있는 AS-IS 파일들 불러오기2) S3에 TO-BE 파일들 업로드하면서 TO-BE 파일 테이블에 데이터 INSERT 2. 서비스 개발1) 별도 마이그레이션 패키지 생성2) 업로드, 다운로드 서비스 개발3) 테스트 3. 서비스 프로세스 순서1) TO-BE 파일 목록을 마이그레이션한 DB에서 조회2) 해당 Key 값으로 AS-IS 데이터 조회및 파일 다운로드3) TO-BE 데이터 가공 및 PK 매핑 테이블 등록 4) TO-BE 데이터 등록및 파일 업로드/** * 데이터 마이그레이션 */@Transactionalpublic void setMigration..
📌 참고사항사용DB : Oracle, Postgresql개발 환경 : Java, SpringBoot1. 계획1) AS-IS 마이그레이션 메뉴, TO-BE 마이그레이션 메뉴 분석2) AS-IS 테이블, TO-BE 테이블 매핑정의서 작성3) 공통코드 대체 정의서 작성 2. 서비스 개발1) 별도 마이그레이션 패키지 생성2) 서비스 개발3) 테스트 3. 백업 및 이관1) 백업 테이블 생성2) 작업 테이블 생성3) 백업 및 작업 실행4) 이관후 정합성 체크5) 롤백-- 1. TO-BE 데이터 백업 (전체)DELETE FROM 백업 테이블;INSERT INTO 백업 테이블 SELECT * FROM TO_BE 테이블-- 2. TO-BE 데이터 이관INSERT INTO TO_BE 테이블 SELECT * FROM 작업..
📌 기준 스펙 Spring Boot 3.4.4JDK17Mysql 8.0.331. CustomOauth2UserService@Slf4j@Service@RequiredArgsConstructorpublic class CustomOauth2UserService implements OAuth2UserService { private final UserRepository userRepository; @Override public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2AuthenticationException { ... SimpleGrantedAuthority authority = new Simpl..
📌 기준 스펙Spring Boot 3.4.4JDK17Mysql 8.0.331. SecurityConfig@Configuration@EnableWebSecurity@RequiredArgsConstructorpublic class SecurityConfig { private final CustomOauth2UserService customOauth2UserService; @Bean @Order(0) SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { ... http.oauth2Login(oauth2 -> oauth2 ... ...