mardi 31 mars 2015

Default Poller for MessageEndpoint?

What is the default Poller when just setting up a @MessageEndpoint with a single @ServiceActivator?



@MessageEndpoint
public class MyEndpoint {
@ServiceActivator(inputChannel = "myChannel") //OK without poller
public void chan() {
}
}



  1. Question: which poller does this service activator use?


Then, when I add additional MessageEndpoint, suddenly a poller is required:



@MessageEndpoint
public class MyEndpoint2 {
@ServiceActivator(inputChannel = "myChannel2") //NOK without poller!
public void chan() {
}
}


Result:



Caused by: java.lang.IllegalArgumentException: No poller has been defined for Annotation-based endpoint, and no default poller is available within the context.
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.integration.config.annotation.AbstractMethodAnnotationPostProcessor.configurePollingEndpoint(AbstractMethodAnnotationPostProcessor.java:321)
at org.springframework.integration.config.annotation.AbstractMethodAnnotationPostProcessor.doCreateEndpoint(AbstractMethodAnnotationPostProcessor.java:250)
at org.springframework.integration.config.annotation.AbstractMethodAnnotationPostProcessor.createEndpoint(AbstractMethodAnnotationPostProcessor.java:241)
at org.springframework.integration.config.annotation.AbstractMethodAnnotationPostProcessor.postProcess(AbstractMethodAnnotationPostProcessor.java:160)
at org.springframework.integration.config.annotation.MessagingAnnotationPostProcessor$1.doWith(MessagingAnnotationPostProcessor.java:151)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:496)

Aucun commentaire:

Enregistrer un commentaire