Hi For TCP networking then you can use netty as a server and write a custom codec to plugin to any kind of custom format.
In this codec, you can parse it accordingly to your format. It seems like \n\n is the end of record indicator. See Netty project for how to write custom codec. And there is a simple custom codec example here https://github.com/camelinaction/camelinaction2/tree/master/chapter6/netty/src/test/java/camelinaction And for the asterix component, then we sure love contributions. But it may be an effort to implement it as server part, if there is not something more easy to reuse. Otherwise there is as mention Netty. On Tue, Sep 14, 2021 at 10:08 AM Mario Giammarco <mgiamma...@gmail.com> wrote: > > Hi, > I have used successfully Camel in the past. > But again I want to use it in a message passing project to see if: > - I can do with less lines of code comparing to using only Java > - the readability of the code is improved (so I want to use all Camel > features and not write custom beans to do all the work) > > Basically the project is this: I want to do a Camel application that receives > Asterisk AMI messages from clients, modify them, and send them to several > Asterisk servers depending on enriched message content. > > Actually I have these problems: > > - Camel has an Asterisk component but it seems unused/unsupported/proof of > concept > > - The asterisk component is client only, so I need to create a socket server > and parse messages. Messages are like this: > key: value \n > key: value \n > \n\n > I hoped I can parse a string message like this and convert to a Camel > message (java map) with camel marshallers but I cannot find the right one. Or > probably I need to do an aggregator until double newline but again it seems > too complex to me. > > - I need to keep a state (for example: message come from an authenticated > client) and again I do not see an easy example to follow. > > So I am asking your help and your suggestions! > > Thanks in advance for any help. > Mario > -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2