2016-07-19 6 views
0

나는 스프링 통합으로 스프링 부트와 함께 tomcat에서 실행하려고합니다. 그래서 전쟁으로 패키징합니다.스프링 부트와 스프링 통합 war로 실행

전쟁을 성공적으로 전개 할 수 있지만 주어진 대기열에서 메시지를 수신하지 않습니다. IDE에서 응용 프로그램으로 시작하면 모든 것이 잘 작동합니다. 누군가 다음 코드에서 누락 된 부분이나 다른 방식으로 배포해야하는 부분을 지적 해 줄 수 있습니까?

@Configuration 
@SpringBootApplication 
@IntegrationComponentScan 
@EnableAutoConfiguration 
@EnableIntegration 
public class SpringIntegrationApplication { 

public static void main(String[] args) { 
    SpringApplication.run(SpringIntegrationApplication .class, args); 
} 

@Autowired 
private ActiveMQConnectionFactory activeMQConnectionFactory; 

@Bean 
public IntegrationFlow jmsInboundFlow() { 
    return IntegrationFlows.from(
           Jms.inboundAdapter(this.activeMQConnectionFactory) 
                .configureJmsTemplate(t -> t.deliveryPersistent(true)/*.jmsMessageConverter(myMessageConverter())*/) 
                .destination("testQueue"), // name of the queue 
           e -> e.poller(Pollers.fixedDelay(10000).maxMessagesPerPoll(20)) 
          ) 
          .enrich(e -> e 
            .requestPayload(Message::getPayload) 
            .shouldClonePayload(false)                    
            .<Map<String, String>>headerFunction("originalMessage", m -> m.getPayload(), true) 
          ) 
          .channel("entrypoint") 
          .get(); 
} 

@Router(inputChannel="entrypoint") 
public String route(@SuppressWarnings("rawtypes") Message message) { 

    if (isErrorMessage) { 
     return "done.input"; 
    } 

}

그리고이 Gradle을 (build.gradle)가 그것을 패키지 :

apply plugin: 'java' 
apply plugin: 'eclipse' 
apply plugin: 'war' 
apply plugin: 'maven-publish' 

version = '1.0-SNAPSHOT' 
sourceCompatibility = 1.8 
targetCompatibility = 1.8 
repositories { 
mavenCentral() 
} 


dependencies { 

compile(
    [group: 'org.springframework.integration', name: 'spring-integration-feed', version: springframeworkVersion], 
    'org.springframework.boot:spring-boot-starter-web:1.3.3.RELEASE', 
    'org.springframework.integration:spring-integration-core:4.2.5.RELEASE', 
    'org.springframework.integration:spring-integration-flow:1.0.0.RELEASE', 
    'org.springframework.integration:spring-integration-java-dsl:1.1.2.RELEASE', 
    'org.springframework.integration:spring-integration-http:4.2.5.RELEASE', 
    'org.springframework.integration:spring-integration-jms:4.2.5.RELEASE', 
    'org.springframework.integration:spring-integration-jdbc:4.2.5.RELEASE', 
    [group: 'log4j', name: 'log4j', version: '1.2.17'], 
    [group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.5'], 
    [group: 'javax.servlet', name: 'jstl', version: '1.2'],   
    [group: 'org.apache.activemq', name: 'activemq-amqp', version: '5.13.3'], 
    'javax:javaee-api:7.0' 
) 

//If more required then 
//http://mvnrepository.com/artifact/org.springframework.integration 

testCompile (
    [group: 'junit', name: 'junit', version: '4.11'], 
    [group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '1.3.5.RELEASE'] 
) 

} 

모든 입력은 높게 평가.

답변

관련 문제