Hi Guys, The PayloadTypeRouter is not working properly. I was not able to find any existing thread on that or any bug repport.
The issue is that the traversing of the payload type hierarchy is not checking extended interfaces (Interface with Multiple Inheritance)
Here is one simple use case:
1. Interfaces definition:
2. router declaration:Code:public interface BroadcastStartMsg extends BroadcastMsg public interface BroadcastEndMsg extends BroadcastMsg
BroadcastStartMsg and BroadcastEndMsg must be routed from channelA to channelBCode:<int:payload-type-router input-channel="channelA" > <int:mapping type="BroadcastMsg " channel="channelB"/> </int:payload-type-router>
Problem: The PayloadTypeRouter fail to route any instance of BroadcastStartMsg or BroadcastEndMsg
Reason: the implementation of getChannelIdentifiers (...) in PayloadTypeRouter is checking only implemented interfaces (in this case BroadcastStartMsg or BroadcastEndMsg) but not extended interface (which must be BroadcastMsg).
I'm not sure if the way it's working is an expected behavior.
I implemented my own router to solve it (see attachment), but I thought it must be a default behavior of the payload type router.
Thanks for any feedback on that.


Reply With Quote