Announcement Announcement Module
No announcement yet.
Message-based routing with translater Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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:
    - someChannel
    - clientChannel

    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?

    Thanks Tai

  • #2
    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