Sep 10th, 2008, 09:58 AM
Message-based routing with translater
I have an incoming payload (a map) which will be routed (like the Cafe demo) to one of these two channels:
In the normal case the payload is passed to someChannel. In case the payload is incomplete (e.g. missing certain keys in the map) then it should go to the clientChannel. In this case I do not want to pass the same payload but it will be translated into some client-readable payload.
Of course the client endpoint receiving the payload from this channel can take care of this but that would be the same logic like it is implemented in the Router (where certain keys are checked).
Is it somehow possible to implement that in one component: defining the channel and transforming the payload?
Sep 11th, 2008, 04:15 PM
I think the solution is the following:
1. Translator: incoming map is either returned as-is or a client payload is returned (e.g. of type IClientPayload)
2. the message is send to a routerChannel
3. a Router receives the message and depending of the payload's type it is send to someChannel or clientChannel