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
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