2016-08-05 3 views
4

다음과 같은 구조를 가지고 있습니다.스프링 통합 애그리 게이터가 올바르게 작동하지 않습니다.

다음은 내 Aggregator 클래스입니다.

@Component("projectAggregator") 
public class ProjectAggregator { 

@Aggregator 
public boolean aggregatingMethod(List<Map<String, List<Project>>> items) { 
//////// CODE ////// 
} 

@ReleaseStrategy 
public boolean releaseChecker(List<Message<?>> messages) { 
//////CODE///// 
} 

@CorrelationStrategy 
public Map<String, List<Project>> correlateBy(Map<String, List<Project>> item) { 
    return item; 
} 

문제는 내가 @ReleaseStrategy 방법에 메시지 길이를 인쇄하면이 항상 증가해야 내 지식에 따르면 1. 남아있다. 위에서 언급 한 코드에 문제가있는 것을 찾는데 도와 주시겠습니까?

답변

1

나중에 게시/구독자에게 보낸 메시지를 집계하려면 apply-sequence에서 true으로 설정해야합니다.

사실이면 correlationId 및 시퀀스 정보가 메시지 헤더에 추가됩니다.

<xsd:attribute name="apply-sequence" type="xsd:string" default="false"> 
    <xsd:annotation> 
     <xsd:documentation> 
      Specify whether the sequence size, sequence number, and correlation id 
      headers should be set on 
      Messages that are sent through this channel. 
     </xsd:documentation> 
    </xsd:annotation> 
</xsd:attribute> 
관련 문제