Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kafka producer configuration #23

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Marjori24
Copy link

No description provided.

@CLAassistant
Copy link

CLAassistant commented Dec 2, 2024

CLA assistant check
All committers have signed the CLA.

Signed-off-by: Marjori Martinez <[email protected]>
Signed-off-by: Marjori Martinez <[email protected]>
Signed-off-by: Marjori Martinez <[email protected]>
Signed-off-by: Marjori Martinez <[email protected]>
Signed-off-by: Marjori Martinez <[email protected]>
Signed-off-by: Marjori Martinez <[email protected]>
Signed-off-by: Marjori Martinez <[email protected]>
Signed-off-by: Marjori Martinez <[email protected]>
@@ -329,6 +341,23 @@ public static class AuditLoaderConf {
public static final String PROP_SECRET_KEY = "secret_key";
public String secretKey = "";

public static String PROP_KAFKA_ENABLE = "kafka_enableMSK";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is normal Kafka or Confluent not supported?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normal Kafka supported.

@@ -392,6 +469,9 @@ public void run() {
AuditEvent event = auditEventQueue.poll(5, TimeUnit.SECONDS);
if (event != null) {
assembleAudit(event);
if (kafkaEnable) {
sendToKafka(event);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it send a message to kafka when each event arrives? Will it cost FE too resource to process events?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, when each audit event arrives it will be send to the kafka queue. It will not generate extra cost because we are only sending messages to the kafka queue, not doing any extra process to it.

@gengjun-git
Copy link

gengjun-git commented Jan 15, 2025

@Marjori24 Thank you for your contribution. Could you add the kafka plugin into a sub module in this project.

fe-plugins-auditloader
                                     / sr               // the current plugin 
                                     / kafka         // the new plugin 
                                     / pom.xml   //  common maven dependency.

This will make it easier to maintain

You can refer to starrocks/fe to learn how to build multiple modules.

@Marjori24
Copy link
Author

Marjori24 commented Jan 20, 2025

@gengjun-git hi!

  1. Just to confirm, the new structure will be:

/src
/kafka
/lib
pom.xml

  1. Could you share the link to know how to build multiple modules, please?
  2. In this new folder, are you referring to add the whole class or just the "sendToKafka" method? just asking because you quoted the folder as "new plugin"

@gengjun-git
Copy link

@gengjun-git hi!

  1. Just to confirm, the new structure will be:

/src
/kafka
/lib
pom.xml

  1. Could you share the link to know how to build multiple modules, please?
  2. In this new folder, are you referring to add the whole class or just the "sendToKafka" method? just asking because you quoted the folder as "new plugin"

@Marjori24

  1. The first dir is sr(starrocks), it should include all the files of the current repository
  2. I have not documents to share the maven multi modules, you can search from internet or refer to starrocks/fe, because fe is a multi modules maven project with fe-common, fe-core, hive-udf, plugin-common.
  3. Just the sendToKafka, We should separate the two modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants