I don’t feel it would be a big hit in performance because Kafka works very fast. I think the speed difference would be negligible. Why are you worried about stability? I’m just curious because it doesn’t seem like it would be unstable, but maybe it would be a bit overkill for one app and some decoupling might make sense.
Sent from my iPhone > On Jan 24, 2019, at 9:59 PM, Raghavendran Chellappa > <raghavendra...@gmail.com> wrote: > > Hi All, > We have a Spring based web app. > > We are planning to build an 'Audit Tracking' feature and plan to use Kafka > - as a sink for storing Audit messages (which will then be consumed and > persisted to a common DB). > > > > We are planning to build a simple, ‘pass-through’ REST service which will > take a JSON and push it into the appropriate Kafka topic. > > This REST service will be called from various pages (from server side) in > the web app (during Create, View, Edit actions) to store the Audit entries. > > > > My question is can we directly have Kafka Producers in the web app so that > we post messages to Kafka Topic directly (instead of going through a > Webservice)? > > Will adding a Kafka Producer in web app will make the app less stable (make > pages less performant)? This is one of the reasons why we want to hide the > Kafka producer complexity behind the webservice. Also we feel that this > webservice can be a starting point for a generic “Auditing service” that > can be used by other applications, in the enterprise, in the future. > > > > I think the ‘pass-through’ webservice is not required and it is OK to push > messages directly from web app to Kafka (but unable to point to any > examples of this being done or any benefits of doing so). > > > > What do you think? > > > > Thanks, > > Ragha