![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/bsD81D/btsHqJ4lca9/6AfPfyfwwPS4jXPZMCaSik/img.png)
개요디렉토리 단위로 S3에 업로드를 할 때 TransferManager를 사용한다.간혹 디렉토리의 업로드시 누락되는 파일이 존재하였다.쓰기 작업중인 파일이 문제일 것이라고 생각하고 쓰기 작업중일 때 어떻게 에러가 발생하는지 재현하였다. 주의점(미리 결론)디렉토리 작업시에는 디렉토리의 작업이 완료된 것을 확인한다.재현작업에서 10개의 파일이 업로드 되기를 기대하였지만, 7개의 파일만 업로드를 시도하였다.쓰기 작업중인 파일은 업로드에 실패한다.정확히 어떤 이유로 실패인지는 검증하지 않았다.타임아웃을 꼭 넣어라.작업 완료인지는 MultipleFileUpload.Progress.PercentTransferred의 값으로 판단하게 되는데 이 값만 있다면 무한 루프에 빠질 가능성이 있다.각 파일에 대한 progre..
개요특정 폴더에 파일(디렉토리)이 복사되면 그 파일을 핸들링 하는 처리가 필요하다.특정 폴더는 네트워크상에 있는 공용 폴더이다.파일의 감시는 Spring Integration을 이용하면 간단하게 해당 생성 파일의 java.io.File인스턴스를 얻을 수 있다. 문제점파일을 핸들링할 때 파일(특히 디렉토리)이 완료되지 않은 상태일 가능성이 있다는 것을 알게 되었다. Spring integration코드 예제빈 설정@Configurationpublic class BeanConfig { @Bean public IntegrationFlow integrationFlow(){ return IntegrationFlow.from(Files.inboundAdapter(new File("c:/inb..
개요 디렉토리에 파일이 생성되는 경우에 감시하는 라이브러리로써 spring-integration을 사용하고 있다. 설정 방법은 간단한데 IntegrationFlow를 반환하는 빈을 설정하면 된다. 복수개의 디렉토리를 감시하는 경우 아래와 같이 복수개로 설정하면 된다. @Bean public IntegrationFlow integrationFlow1() { return IntegrationFlow .from(Files.inboundAdapter(new File("c:/inbound1")) , e -> e.poller(Pollers.fixedDelay(1000).maxMessagesPerPoll(10))) .handle(message -> System.out.println(message.getPayload(..
- Total
- Today
- Yesterday
- excel to markdown
- 로그테스트 #콘솔로그테스트 #System.out
- QR코드읽기 #ReadQRCode
- Two Sum
- multipleIntegrationFlow
- spring-integration
- AWS #X-Ray
- json
- logback #logstash #LoggingEventCompositeJsonEncoder #로그JSON
- springintegration #파일감시 #디렉토리감시 #파일완료검사
- lombok #maven build #sym
- yaml
- Postgresql #MultiTruncate
- 로그파일인덱스
- palindrome number
- SnakeYAML
- Maven LF #메이븐 개행문자
- Python #Powertools
- leetcode
- PostgreSQL #sequnceName
- add two numbers
- cannotResolveSymbol
- PostgreSQL #FOR UPDATE #SKIP LOCKED
- reverse integer
- spring #redis #redis-cluster
- excel table
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |