Skip to content

Modifying IPFIXcol2 Kafka Output Plugin to Support Multiple Topics #106

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

Open
Lidhoria opened this issue Feb 20, 2025 · 1 comment
Open

Comments

@Lidhoria
Copy link

I hope you are doing well.

I have been working with the IPFIXcol2 collector and its Kafka output plugin as defined in the startup.xml configuration file. Currently, I can specify a single Kafka topic in the configuration, but I am interested in extending this functionality to support two separate topics within Kafka.

Could you please clarify the following:

Is it currently possible to define multiple Kafka topics in the configuration file under the Kafka output plugin?
If not, would it be feasible to modify the IPFIXcol2 code to support two separate topics within Kafka? If so, could you provide guidance on the best approach to implement this?
Are there any potential limitations or concerns regarding such a modification?
Your insights and suggestions would be greatly appreciated. Thank you for your time and support!

@Lukas955
Copy link
Collaborator

Lukas955 commented Feb 20, 2025

Hi,

I think it should be enough to just list another output that will have a different topic. For example:

    ...

    <outputs>
        <!-- First instance -->
        <kafka>
            <name>Send to Kafka T1</name>
            <brokers>127.0.0.1</brokers>
            <topic>ipfix_one</topic>
            <blocking>false</blocking>
            <partition>unassigned</partition>

            <!-- Zero or more additional properties -->
            <property>
                <key>compression.codec</key>
                <value>lz4</value>
            </property>
        </kafka>

        <!-- Second instance -->
        <kafka>
            <name>Send to Kafka T2</name>
            <brokers>127.0.0.1</brokers>
            <topic>ipfix_two</topic>
            <blocking>false</blocking>
            <partition>unassigned</partition>

            <!-- Zero or more additional properties -->
            <property>
                <key>compression.codec</key>
                <value>lz4</value>
            </property>
        </kafka>
    </outputs>

    ...

Note: It seems that the librdkafka API itself, which is used to communicate with Apache Kafka, does not allow to send one message to multiple topics at the same time. The above configuration will create two separate connections, with each producing under its own topic.

Lukas

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

No branches or pull requests

2 participants