In general, I wouldn't bother too much about the Camel Context, Exchanges and producer tasks. Sound the best way to do this is by just chaining various Camel routes and use direct or seda endpoints between them.
Raymond On Wed, Oct 12, 2022 at 10:31 AM Stefan Kok <stefan....@centilliard.io> wrote: > Hi All > > Background: > > I have a custom camel producer receiving messages asynchronously from a > web socket server. The next phase requires that we respond to events > emitted from the web socket server which we did not initiate from a > client perspective on the open web sockets. > > Question: > When we receive such an event on the Producer Task implementation what > would be the correct camel way to process it? In other words, how do I > send the received event to where it is needed? > > Here are some of my ideas based on my limted knowledage and exprience: > > 1) Use the camel context, create a new exhange and send the message > directly to an endpoint from the producer task. In ASCI art: > incoming web socket event --> producer task (create new exchange) --> > send to some endpoint like SEDA > > 2) Send a rest client resquest from the producer task to the intended > destination directly from the producer task. (Seems like a bad idea > from the start to me) > incoming web socket event --> producer task (create new exchange) --> > send with rest client to > > As always > Thank you in advance. > > Regards Stefan >