Reverted the RuntimeBeanReference to a String value for the constructor-arg of the Subscription object when parsing an endpoint. That is necessary to handle the case where channels are 'auto-created' by the MessageBus on demand (e.g. HelloWorldDemo).
This commit is contained in:
@@ -30,7 +30,6 @@ import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.springframework.integration.ConfigurationException;
|
||||
import org.springframework.integration.endpoint.ConcurrencyPolicy;
|
||||
import org.springframework.integration.handler.DefaultMessageHandlerAdapter;
|
||||
import org.springframework.integration.scheduling.PollingSchedule;
|
||||
import org.springframework.integration.scheduling.Schedule;
|
||||
import org.springframework.integration.scheduling.Subscription;
|
||||
@@ -111,7 +110,7 @@ public abstract class AbstractTargetEndpointParser extends AbstractSingleBeanDef
|
||||
}
|
||||
if (StringUtils.hasText(inputChannel)) {
|
||||
RootBeanDefinition subscriptionDef = new RootBeanDefinition(Subscription.class);
|
||||
subscriptionDef.getConstructorArgumentValues().addGenericArgumentValue(new RuntimeBeanReference(inputChannel));
|
||||
subscriptionDef.getConstructorArgumentValues().addGenericArgumentValue(inputChannel);
|
||||
if (schedule != null) {
|
||||
subscriptionDef.getConstructorArgumentValues().addGenericArgumentValue(schedule);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,6 @@ public class HelloWorldDemo {
|
||||
MessageChannel outputChannel = channelRegistry.lookupChannel("outputChannel");
|
||||
inputChannel.send(new StringMessage("World"));
|
||||
System.out.println(outputChannel.receive().getPayload());
|
||||
context.stop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<message-bus auto-create-channels="true"/>
|
||||
|
||||
<handler-endpoint input-channel="inputChannel"
|
||||
<handler-endpoint input-channel="inputChannel"
|
||||
output-channel="outputChannel"
|
||||
handler="helloService"
|
||||
method="sayHello"/>
|
||||
|
||||
Reference in New Issue
Block a user