user3823859
user3823859

Reputation: 469

processing real time packet using spark streaming

I have received real time packet using jnetpcap. Can anyone please tell me how to extract the packet header and other details from a live packet using spark streaming?

Upvotes: 0

Views: 701

Answers (1)

Niels Bech Nielsen
Niels Bech Nielsen

Reputation: 4859

If you have read through spark streaming programming guide, you will have discovered that you can implement a custom Receiver for your stream. However, there are little examples in the actual guide, and you will have to read the examples and javadoc specified on the bottom of the page.

This project is a custom receiver, which basically:

  1. Extends Receiver
  2. Implements onStart and onStop methods
  3. Calls store method with the data to pass through the stream

It should be as easy as that. Which parts of the package to parse and how is probably your own decision. You just feed the package in at source level and write your own transformers etc, according to the programming guide.

Upvotes: 1

Related Questions