PDA

View Full Version : limited xml namespace configuration within <chain>



mfuzzey
Jan 12th, 2010, 08:29 AM
Hi,

I tried to use payload-type-router within a chain thus:

<chain input-channel="input">
<splitter>
<beans:bean class="..."/>
</splitter>
<payload-type-router>
<mapping type="com.example.Widget" channel="widgets" />
<mapping type="com.example.Sprocket" channel="sprockets" />
<payload-type-router>
</chain>

Unfortunately that fails since the xsd does not allow <payload-type-router> to be a child of <chain>

It does work with a plain <router> but that is rather verbose:

<chain input-channel="input">
<splitter>
<beans:bean class="..."/>
</splitter>
<beans:bean class="org.springframework.integration.router.PayloadType Router">
<beans:property name="payloadTypeChannelMap">
<beans:map>
<beans:entry key="com.example.Widget" value-ref="widgets"/>
<beans:entry key="com.example.Sprocket" value-ref="sprockets"/>
</beans:map>
</beans:property>
</beans:bean>

Is there a reason for this?

Cheers,

Martin

Mark Fisher
Jan 12th, 2010, 08:32 AM
I think we just need to modify the schema to allow that. Could you please raise an issue in JIRA?

Thanks,
Mark

iwein
Jan 13th, 2010, 08:16 AM
Correct, a mere schema modification should do it. The MessageChainHandler was designed to be very lenient in what it accepts as a handler.