[INT-3267] Bug in org.springframework.integration.config.xml.AbstractPollingInboundChannelAdapterParser.doParse Created: 20/Jan/14  Updated: 20/Jan/14  Resolved: 20/Jan/14

Status: Closed
Project: Spring Integration
Component/s: Build, Core
Affects Version/s: 3.0 GA
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Cedomir Igaly Assignee: Artem Bilan
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File AbstractPollingInboundChannelAdapterParser.java.diff    
Issue Links:
duplicates INT-3240 Inbound Channel Adapter Parser doesn'... Closed


When source does not have an id attribute, it will be generated:

> String channelAdapterId = this.resolveId(element, (AbstractBeanDefinition) source, parserContext);

and it will look something like org.springframework.integration.endpoint.MethodInvokingMessageSource#0

then, this will be changed by appending ".source":

> String sourceBeanName = channelAdapterId + ".source";

and bean will be registered under that name and that name will be used to add property reference:

> adapterBuilder.addPropertyReference("source", sourceBeanName);

Next time when AbstractPollingInboundChannelAdapterParser.doParse will be invoked, ID generated will be the same since there is no bean named "org.springframework.integration.endpoint.MethodInvokingMessageSource#0" (but there is bean named "org.springframework.integration.endpoint.MethodInvokingMessageSource#0.source") and property reference added will be (again) "org.springframework.integration.endpoint.MethodInvokingMessageSource#0.source" instead of proper one.

Suggested fix is to replace addPropertyReference with addPropertyValue.

Comment by Artem Bilan [ 20/Jan/14 ]

It was fixed recently (INT-3240).

Generated at Fri Aug 14 13:51:08 UTC 2020 using Jira 8.5.4#805004-sha1:0444eab799707f9ad7b248d69f858774aadfd250.