• Kafka Stream - Time

    Time Time 스트림 프로세싱에서 시간은 중요한 개념이다. 그리고 시간을 어떻게 모델링하고 통합하는지도 중요하다. 예를 들어 Windowing과 같은 연산은 시간 경계를 기반으로해서 정의된다. 카프카 스트림은 다음과 같은 시간 개념을 지원한다. Event-time : 이벤트 또는 레코드가 발생한 시점. Event-time semantics를 위해서는 레코드를 생성할 때 레코드에 타임스탬프를 포함해야 한다. 즉 Event-time은 레코드가 생성되는...


  • How to manage the size of state stores using tombstones?

    How to manage the size of state stores using tombstones? 이 글은 Kafka Stream Processor API 또는 DSL 사용방법에 대한 일반적인 패턴을 설명한다. 본 글은 Kafka Stream Usage Pattern를 참고하길 바란다. How to manage the size of state stores using tombstones? Aggregation을 사용하는 어플리케이션은 State Store에서 더 이상 필요하지 않은...


  • Check Point

    Checkpoint CheckPoint Kafka Streams 어플리케이션이 State Store를 초기화 할 때, 체크포인트 파일이 존재하는지 확인한다. 체크포인트 파일은 State Store에 플러쉬되고 change-log 토픽에 쓰여진 가장 최신의 records에 대한 오프셋들을 저장하고 있다. 만약에 체크포인트 파일이 존재하고 특정 change-log 파티션에 대한 체크 포인트가 존재하면, 그 State Store의 복구는 체크포인트 파일에 존재하는 오프셋부터 시작이 된다....


  • Spring Data JPA를 활용한 페이징 처리

    Spring Data JPA를 이용한 페이징 처리 PagingAndSortingRepository PagingAndSortingRepository는 CrudRepository를 상속하고 있는 인터페이스이다. PagingAndSortingRepository는 페이징 처리를 위한 메소드를 제공하고 있다. public interface PagingAndSortingRepository<T, ID extends Serializable> extends CrudRepository<T, ID> { Iterable<T> findAll(Sort sort); Page<T> findAll(Pageable pageable); } 페이지의 크기가 20인 유저 페이지의 2번째 페이지를 가져오려면 아래와 같은 코드를 작성하면 된다. Pageable...


  • Serve static resources with spring

    ResourceHttpRequestHandler ResourceHandlerRegistry는 ResourceHttpRequestHandler를 설정하여 클래스패스, WAR, 파일시스템에 존재하는 정적 자원을 제공하기 위해서 사용된다. ResourceHandlerRegistry는 설정 클래스 내에서 프로그래밍 방식으로 설정할 수 있다. Serving a Resource Stored in the WAR 만약에 webapp/resources 폴더에 위치한 특정 css 파일을 가져온다고 해보자. 주로 정적 파일은 webapp/resources 폴더에 위치한다. 그러면 아래와 같은 설정을 추가해주면 된다....