[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:
Duplicate
duplicates INT-3240 Inbound Channel Adapter Parser doesn'... Closed

 Description   

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.



 Comments   
Comment by Artem Bilan [ 20/Jan/14 ]

It was fixed recently (INT-3240).
Thanks

Generated at Sat Jan 25 10:47:44 UTC 2020 using Jira 7.13.8#713008-sha1:1606a5c1e7006e1ab135aac81f7a9566b2dbc3a6.