<p dir="ltr">Well, LogWriter assumes a specific semantics from the underlying transport. Async APIs usually give you access to the fd, and the needed I/O event mask. If that's the case, you can probably integrate it to syslog-ng's mainloop, which is ivykis based (an async event lib).</p>
<p dir="ltr">But you can create a separate event loop if that's easier. E.g. use a single thread for all kafka destinations.</p>
<p dir="ltr">Can you explain your use-case why the existing kafka destination is not good enough? Is it performance, is it java?</p>
<div class="gmail_quot<blockquote class=" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> ❦ 22 janvier 2016 12:43 +0100, "Scheidler, Balázs" <<a href="mailto:balazs.scheidler@balabit.com">balazs.scheidler@balabit.com</a>> :<br>
<br>
> well, the afsocket one. that's a completely nonblocking destination<br>
> that implements udp/tcp/unix-stream/unix-dgram/syslog/network sources<br>
> and destinations.<br>
><br>
> It basically boils down to using a LogWriter class that does the heavy<br>
> lifting at least as long as your transport protocol is simple enough.<br>
> Probably the simplest is to create a LogProto implementation and let<br>
> the afsocket driver do the rest.<br>
><br>
> Asynchronous sources/destinations operate on a set of worker threads<br>
> (in contrast to a dedicated thread) and are driven by the epoll()<br>
> based event loop.<br>
<br>
It's for the librdkafka-based kafka destination. So, the third-party<br>
library is taking care of all the transport stuff. Is the afsocket one<br>
still a good example for async stuff in this case? I didn't have a look<br>
yet.<br>
--<br>
Don't compare floating point numbers just for equality.<br>
- The Elements of Programming Style (Kernighan & Plauger)<br>
______________________________________________________________________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" rel="noreferrer" target="_blank">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" rel="noreferrer" target="_blank">http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" rel="noreferrer" target="_blank">http://www.balabit.com/wiki/syslog-ng-faq</a><br>
<br>
</div>