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

Support AOT for basic consumer app #2176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

latop2604
Copy link

@latop2604 latop2604 commented Jan 21, 2024

Hello, I managed to have my app working with AOT on windows and linux (ubuntu wsl). I tested only with net8.0 framework.

It's a basic consumer app with avalonia UI. But can be summarized as below:

var config = new ConsumerConfig
{
    BootstrapServers = kafkaServers,
    GroupId = "GroupIdPrefix" + Guid.NewGuid(),
    AutoOffsetReset = AutoOffsetReset.Latest,
};

using var consumer = new ConsumerBuilder<string, byte[]>(config)
    .SetErrorHandler((_, e) => {/* ... */})
    .Build();

consumer.Subscribe("my-topic");

while (true)
{
    var result = consumer.Consume(TimeSpan.FromMilliseconds(1000));
    // ...
}

I don't know if it will work with the current list of TargetFrameworks or if we need to add net8.0 explicitly.

Waiting for your feedback.

Should fix #2146

Copy link

cla-assistant bot commented Jan 21, 2024

CLA assistant check
All committers have signed the CLA.

@latop2604
Copy link
Author

Any opinion about this mr @anchitj ?

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.

.NET 8 and Native AOT approach
1 participant