Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular.js integration with apache kafka

I am new to apache kafka and apache spark. I want to integrate the kafka with my angularjs code. Basically I want to make sure that, when a user click on any link or searches anything on my website, then the those searches and clicks should be triggered as an event and send it to the kafka data pipe for the use of analytics. My question is how can I integrate frontend code which is in angular.js to apache kafka? Can I send the searches and click stream data directly to apache spark using kafka pipeline or do I need to send those data to kafka and apache spark will do polling to kafka server and receive the data in batches?

like image 715
Scalaboy Avatar asked Mar 23 '26 00:03

Scalaboy


1 Answers

I don't think (just cannot find at glance) there is Kafka client for front-end JavaScript. I cannot actually imagine stable setup when millions of producers (each client's browser) writing to the same Kafka topic. What you need to do in Angular, is to call your server side function to log your events in Kafka. Server side code may be written in a bunch of languages, including JavaScript for node.js. Please take a look for available clients at Kafka Documentation

Update 2019: There are several projects implementing REST over HTTP(s) proxy for producer and consumer interfaces. For example Kafka Rest project (source). Never tried these by myself though.

like image 176
Robert Navado Avatar answered Mar 24 '26 13:03

Robert Navado