spring-boot 55

SpringBoot 로깅 - 모든 로그 항목 시작 시 관련 없는 하이픈 사용

SpringBoot 로깅 - 모든 로그 항목 시작 시 관련 없는 하이픈 사용 SpringBoot 1.3.5의 콘솔과 파일 로그에서 선두 하이픈을 제거하려고 합니다.기본 로그백 구성이 있는 RELEASE. 로깅 패턴은 다음과 같습니다. logging: pattern: console: '%d{yyyy-MM-dd HH:mm:ss.SSS} %clr([${spring.application.name}]){red} %clr(%5p) %clr(${PID:- }){magenta} %clr(---){faint} %X{req.requestId} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WO..

programing 2023.08.18

어떻게 봄에 같은 콩의 여러 인스턴스를 얻을 수 있습니까?

어떻게 봄에 같은 콩의 여러 인스턴스를 얻을 수 있습니까? 기본적으로, 봄 콩은 싱글톤입니다.동일한 원두의 여러 인스턴스를 가공할 수 있는 방법이 있는지 궁금합니다. 현재 제가 하는 일은 다음과 같습니다. @Configuration public class ApplicationMain { @Value("${service.num: not configured}") private int num; //more code @PostConstruct public void run(){ for (int i = 0; i < num ; i++) { MyService ser = new MyService(i); Future tasks = executor.submit(ser); } } } 서비스 클래스입니다. public clas..

programing 2023.08.18

Swagger API 응답에서 개체 목록 설정

Swagger API 응답에서 개체 목록 설정 Swagger를 사용하여 API의 응답으로 객체 목록을 보내고 싶습니다. @ApiResponse(code = 200, message = ApiResponseMessages.ITEM_FETCHED, response = "") 수업이 있어요 class Item{ int id; String item_name; } 저는 다음과 같은 답변을 원합니다. { { "id" : 0, "item_name" : "" } { "id" : 0, "item_name" : "" } { "id" : 0, "item_name" : "" } } 어떻게 해야 돼요?어떤 도움이라도 주시면 감사하겠습니다.다음과 같이 ApiResponse를 설정할 수도 있습니다. @ApiResponse(code ..

programing 2023.08.13

시작할 때 Spring Cloud Config Server가 PropertySource를 찾을 수 없음

시작할 때 Spring Cloud Config Server가 PropertySource를 찾을 수 없음 Spring Cloud Config Server를 시작할 때 다음 오류가 발생합니다. Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/configserver/default/master":Connection refused; nested exception is java.net.ConnectException: Connection refused 그러나 브라우저에서 해당 URL을 누르면 해당 URL이 존재하고 구성 서버가 작동합니다.무슨 일입니까? application.yml server: port: 8888..

programing 2023.08.13

application.yml Spring Cloud Gateway에서 사용자 지정 필터를 지정하는 방법

application.yml Spring Cloud Gateway에서 사용자 지정 필터를 지정하는 방법 사용자 지정 게이트웨이 필터 MYGatewayFilter.java 파일이 있습니다. 이제 application.yml에 기록된 경로로 이 게이트웨이 필터를 사용합니다. spring: cloud: gateway: routes: - id: login2_route uri: http://127.0.0.1:8083/login predicates: - Path: /login/ filters: 위 경로에 대한 필터를 어떻게 정의합니까? 사용자 지정 필터 My GatewayFilter.java public class MyGatewayFilter implements GatewayFilter { @Override pub..

programing 2023.08.13

메서드 apis(java.util.function)입니다.ApiSelectorBuilder 유형의 술어)는 적용되지 않습니다.

메서드 apis(java.util.function)입니다.ApiSelectorBuilder 유형의 술어)는 적용되지 않습니다. @Bean.api 메서드는 아래 오류를 제공합니다.평소처럼 @Beans로 Swagger config 클래스를 추가했습니다. The method apis(java.util.function.Predicate) in the type ApiSelectorBuilder is not applicable for the arguments (com.google.common.base.Predicate) 내 Config 클래스는 다음과 같습니다. import org.springframework.context.annotation.Bean; import org.springframework.context..

programing 2023.07.29

Spring Data Rest - 내포된 특성별 정렬

Spring Data Rest - 내포된 특성별 정렬 Spring Boot 1.5.1 및 Spring Data Rest를 사용하는 데이터베이스 서비스를 보유하고 있습니다.MySQL 데이터베이스에 엔티티를 저장하고 Spring의 PagingAndSortingRespository를 사용하여 REST를 통해 액세스합니다.중첩 매개 변수별 정렬이 지원되지만 중첩 필드별 정렬 방법을 찾을 수 없습니다. 다음과 같은 수업이 있습니다. @Entity(name = "Person") @Table(name = "PERSON") public class Person { @ManyToOne protected Address address; @ManyToOne(targetEntity = Name.class, cascade = { ..

programing 2023.07.29

@Configuration Properties를 @Configuration으로 자동 배선하는 방법은 무엇입니까?

@Configuration Properties를 @Configuration으로 자동 배선하는 방법은 무엇입니까? 다음과 같이 정의된 속성 클래스가 있습니다. @Validated @ConfigurationProperties(prefix = "plugin.httpclient") public class HttpClientProperties { ... } 다음과 같은 구성 클래스: @Configuration @EnableScheduling public class HttpClientConfiguration { private final HttpClientProperties httpClientProperties; @Autowired public HttpClientConfiguration(HttpClientProper..

programing 2023.07.24

wkhtmltopdf Docker 이미지 설치 및 실행 방법

wkhtmltopdf Docker 이미지 설치 및 실행 방법 wkhtmltopdf를 설치하고 실행하고 싶습니다.Dockerfile의Spring-Boot애플리케이션을 구축하고 실행할 때Spring-boot어플.아래 주어진 스크립트를 작성했습니다.Dockerfilewkhtmltopdf를 설치합니다. FROM debian:jessie RUN apt-get update \ && apt-get install -y \ curl \ libxrender1 \ libfontconfig \ libxtst6 \ xz-utils RUN curl "https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz" -L -o "wkh..

programing 2023.07.24

Java Spring 앱에서 rediscalls를 기록/삭제하는 방법

Java Spring 앱에서 rediscalls를 기록/삭제하는 방법 java springboot microservice(쿼리 및 응답)에서 발생하는 redis 활동을 기록하는 가장 간단한 방법을 찾고 있습니다. redis에서/to redis에서 데이터를 추출/삽입할 때마다 (주 스프링 부트 로그 파일에서) 로그 줄을 보고 싶습니다. 내 코드는 다음과 같은 일반적인 스프링 프레임워크 데이터 redis 접근 방식을 사용합니다. import org.springframework.data.redis.core.RedisHash; import org.springframework.data.redis.core.TimeToLive; @RedisHash public class InternalAddress { private..

programing 2023.07.24