Spring @Async에서 다른 큐 용량으로 여러 실행 프로그램 풀을 갖고 싶다면 "하나의 AsyncAnnotationBeanPostProcessor가 컨텍스트 내에 존재할 수 있습니다"오류가 발생합니다.동일한 컨텍스트에서 다중 스레드 풀 지원
아래 링크에서 나는 이것이 가능하지 않음을 관찰했습니다.
Only one AsyncAnnotationBeanPostProcessor may exist within the context
http://forum.spring.io/forum/spring-projects/container/79086-multiple-executor-possible
Spring's @Scheduled error : Only one AsyncAnnotationBeanPostProcessor may exist within the context
다음(스프링 통합을 사용하는 것보다 다른) 어떤 대안이 있는가 내 구성
,691,363입니다<!- Executor A -->
<task:annotation-driven executor="executor_A"/>
<task:executor id="executor_A" pool-size="100"/>
<!- Executor B -->
<task:annotation-driven executor="executor_B"/>
<task:executor id="executor_B" pool-size="100"/>
아래 위의 두 가지 구성이 다른 XML 컨텍스트 파일에 정의 된 모든 소스 코드에서 동일한 응용 프로그램 컨텍스트
에로드처럼210
내 구성은, 나는 특정에 매핑하고 내가 배포 할 때 집행
@Async("executor_A")
public void testExecutorA()
{
}
@Async("executor_B")
public void testExecutorB()
{
}
, 나는 다음과 같은 오류를 얻을
2014년 7월 22일 09 : 41 : 26.644 [localhost-startStop-1] 오류 osweb.context.ContextLoader U : SC : TX : 컨텍스트 초기화에 실패했습니다. org.springframework.beans.factory.parsing.BeanDefinitionParsingException : 구성 문제 : Bean 정의를 가져 오지 못했습니다. URL 위치 [classpath * :/META-INF/domainconfig/* - domain-context.xml] 부적절한 리소스 : ServletContext 리소스 [/WEB-INF/spring/root-context.xml]; 중첩 예외는 org.springframework.beans.factory.parsing.BeanDefinitionParsingException : 구성 문제 : 단 하나의 AsyncAnnotationBeanPostProcessor가 컨텍스트 내에 존재할 수 있습니다. 잘못된 리소스 : URL [jar : file :/D : /tomcat/apache-tomcat-7.0.29/webapps/myapp/WEB-INF/lib/myapp-domain-1.0.0.jar!/META-INF/domainconfig /my-domain-context.xml]
감사
삶
응답 해 주셔서 감사합니다. 나는 주 qs에 세부 사항을 추가했습니다. – lives
글쎄, 나는 이미 당신에게 대답했습니다. 'task : annotation-driven' 요소를 두 번 정의 할 수는 없습니다. 사용하려는 주 집행자와 한 번만 등록하고 다른 집행자가 필요한 경우 특수 효과에 정의하십시오. –
죄송합니다 - 따라갈 수 없습니다. 다른 실행 프로그램 풀이 필요하고 @Async를 사용하여 주석으로 정의한 경우 - 해당 실행 프로그램 풀의 풀 크기는 무엇입니까? 내가 정의한 기본값이 될 것입니까? 또는 주석에서 풀 크기를 정의 할 수 있습니까? – lives