전체 글

Red Hat의 심심한 블로그입니다.
유튜브와 같이 온라인 영상 서비스들에서 원하는 영상을 재생하려고 하면, 전부 다운로드 후 재생이 아닌 일부만 조금씩 다운로드 후 재생하고 그 이후에 추가로 다운로드 하는걸 알 수 있습니다. Spring Boot에서 영상 파일을 스트리밍 하는 방법을 알아보겠습니다. 환경 Spring Boot 3.1.3 React 18.2.0 React-Player 2.12.0 구조 영상을 가져와서 프론트에 출력하는 구조는 아래와 같습니다. 영상을 재생하기 위해 순서대로 정리해보겠습니다. React에서 영상 데이터 요청 파일 정보(이름, 위치 등)을 Spring Boot에 요청합니다. React-Player를 사용하기 때문에 요청을 url={videoLoader()} 라는 파라미터를 통해 영상을 받아옵니다. Spring B..
RestAPI를 통해 파일을 다운로드 하려면 어떻게 해야할지 알아보겠습니다. 환경 Spring Boot 3.1.3 React 18.2.0 axios 1.4.0 파일 다운로드를 위한 순서 React에서 파일 다운로드 요청 axios를 사용하여 파일 정보를 Spring Boot에 요청합니다. responseType을 blob으로 설정합니다. Spring Boot에서 요청 처리 Controller에서 파일 정보를 받아 Service로 전달합니다. 이후 Service에서 처리된 데이터를 리턴시킵니다. Spring Boot에서 파일 데이터 처리 파일 존재를 확인 후, Resource로 처리하여 리턴합니다. 코드를 통해 확인해 보겠습니다. React import { useEffect, useState } from ..
Spring Batch 5 버전을 어떻게 사용하는지 간단한 예시를 통해 알아보려 합니다. 환경 Spring Batch 5.1.0 Spring Boot 3.1.3 Java 17 MairaDB(MySQL) 설치 // Spring Batch implementation 'org.springframework.boot:spring-boot-starter-batch' // spring-batch-core implementation 'org.springframework.batch:spring-batch-core:5.1.0' application.properties 설정 ### spring batch spring.batch.job.enabled=true spring.batch.jdbc.initialize-schema=a..
에러 로그 및 원인 A problem occurred configuring root project 'log'. > Could not resolve all files for configuration ':classpath'. > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.1.5. Required by: project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.1.5 > No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.1.5 was found. The cons..
Red-Hat
Red Hat의 심심한 블로그