How to write Kafka connector to integrate with Facebook API

0 votes

I am trying to write a Kafka connector to fetch data from the facebook. My problems are, 

1. How to fetch data from facebook through their API without exceeding the limit of API hit provided by Facebook? The connector should call facebook API for data after a specific time interval so that the number of hits won't exceed.

2. Each user can hit the API with their Access Token so users can't share the same topic partition. So how to handle this scenario. Do we have to create one partition for each user?

I read a few guides and blogs to understand Kafka connect and write a connector.

Confluenthttps://docs.confluent.io/current/connect/index.html

Kafka Documentationhttps://kafka.apache.org/documentation/#connect

Conceptually It gave me an idea about what is Kafka connect, how it works and what are the important classes to write a Kafka connector. But still, I am confused that practically how to write and run a connector. I tried to find step by step development guide but didn't get. 

Any tutorial or pdf If you could suggest which have detailed step by step development guide to write and run Kafka connector.

Apr 29, 2019 in Apache Kafka by Neeraj
• 120 points

retagged Apr 29, 2019 by Omkar 2,330 views

1 answer to this question.

0 votes

If you know the limit of API hit provided by Facebook, then you can limit the number of objects returned. To do this, you will have to add the .limit() argument to any field or an edge. For example:

curl -i -X GET \
  "https://graph.facebook.com/{your-user-id}
    ?fields=feed.limit(3)
    &access_token={your-access-token}"

The limit(3) will limit the number of objects in each page to three. Replace this with the limit that Facebook has set and I think it should work. 

Hope this will help.

To know more about Kafka, get your Apache Kafka certification course today.

Thank You

answered Apr 29, 2019 by Kumar

Related Questions In Apache Kafka

0 votes
1 answer

How to write output from Kafka to S3 using a Confluent S3 connector?

Hi@akhtar, To do this task you have to ...READ MORE

answered Apr 3, 2020 in Apache Kafka by MD
• 95,440 points
1,554 views
0 votes
1 answer

How to create kafka producer API?

Hi@akhtar, To create kafka producer API, you can ...READ MORE

answered Feb 11, 2020 in Apache Kafka by MD
• 95,440 points
640 views
0 votes
1 answer

How to create Kafka consumer API?

Hi@akhtar, If you know the kafka producer API ...READ MORE

answered Feb 11, 2020 in Apache Kafka by MD
• 95,440 points
1,271 views
0 votes
1 answer

How can i connect to an api which gives me weather data to Apache kafka?

Hi, To connect an API in kafka, you ...READ MORE

answered Apr 13, 2020 in Apache Kafka by MD
• 95,440 points
1,125 views
0 votes
1 answer

How to reset the offset of messages consumed from Kafka?

The reset option only prints the result ...READ MORE

answered Jul 10, 2018 in Apache Kafka by Shubham
• 13,490 points
13,676 views
0 votes
1 answer

How to commit message offsets in Kafka for reliable data pipeline?

You can use auto.commit.enable to allow Kafka ...READ MORE

answered Jul 10, 2018 in Apache Kafka by Shubham
• 13,490 points
3,312 views
0 votes
1 answer
+2 votes
1 answer

Is Kafka and Zookeeper are required in a Big Data Cluster?

Apache Kafka is one of the components ...READ MORE

answered Mar 23, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
1,847 views
0 votes
1 answer

which one to choose for log analysis?

It is not about that you can ...READ MORE

answered Apr 6, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
529 views
0 votes
1 answer

Getting error while connecting zookeeper in Kafka - Spark Streaming integration

I guess you need provide this kafka.bootstrap.servers ...READ MORE

answered May 24, 2018 in Apache Spark by Shubham
• 13,490 points
2,576 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP