Comments (16)
@brandonh-msft and @ryancrawcour please submit your feedback about this item. Once we agreed, Brandon can start.
from azure-functions-kafka-extension.
if i'm understanding the byte[]
part... this means if they use byte array, we want the function developer to implement the creating of KafkaEventData
objects?
from azure-functions-kafka-extension.
@brandonh-msft and @ryancrawcour please submit your feedback about this item. Once we agreed, Brandon can start.
Looks good to me.
from azure-functions-kafka-extension.
if i'm understanding the byte[] part... this means if they use byte array, we want the function developer to implement the creating of KafkaEventData objects?
this is my understanding too.
@fbeltrao, was this your intention?
from azure-functions-kafka-extension.
Kafka stores the messages as byte[]. The intention is to get the raw data coming from the topic and do all the required serialisation on the function.
The following code does that:
[FunctionName(nameof(ByteArrayUser))]
public static void ByteArrayUser(
[KafkaTrigger("LocalBroker", "users", ConsumerGroup = "azfunc_byte_array", ValueType = typeof(byte[]))] KafkaEventData[] kafkaEvents,
ILogger logger)
{
foreach (var kafkaEvent in kafkaEvents)
{
logger.LogInformation($"users message has {((byte[])kafkaEvent.Value).Length} length");
}
}
The idea would be to be able to replace the parameter definition the following way:
[KafkaTrigger("LocalBroker", "users", ConsumerGroup = "azfunc_byte_array")] byte[][] rawKafkaEvents
Does it make sense?
from azure-functions-kafka-extension.
It is ok for me if you don't think there is value here. The more I think about it the more I have the impression that this issue a nice to have, as there is a way to get things working using KafkaEventData.
This issue is about making it developer friendly.
from azure-functions-kafka-extension.
well, the above code does and doesn't do that. if you look at #43 we never implemented what we actually do with the byte array. So you don't actually get any event data out of the bytestream. This is the piece lacking definition; but if we're saying "if you choose byte[], you need to provide the implementation" that could prove to be difficult given the structure of bindings.
from azure-functions-kafka-extension.
I agree, that constructor shouldn't be there.
The way the KafkaEventData will be built in case the ValueType = typeof(byte[]) is the following:
new KafkaEventData(new ConsumeResultWrapper<TKey, TValue>(consumeResult));
// TValue => byte[]
// ctor will set KafkaEventData.Value to IConsumeResultData.Value which is a byte[]
from azure-functions-kafka-extension.
I will check if I can remove that ctor.
from azure-functions-kafka-extension.
The way the KafkaEventData will be built in case the ValueType = typeof(byte[]) is the following:
new KafkaEventData(new ConsumeResultWrapper<TKey, TValue>(consumeResult)); // TValue => byte[] // ctor will set KafkaEventData.Value to IConsumeResultData.Value which is a byte[]
so IConsumeResultData.Value
is always byte[]
?
from azure-functions-kafka-extension.
No, it will be of the type in which the KafkaListener<TKey, TValue> was created
from azure-functions-kafka-extension.
got it. so you were just saying that the only case where KafkaEventData.Value
will end up as byte[]
is the case where it gets set as part of the ConsumeResultWrapper
. 👍
from azure-functions-kafka-extension.
Does this mean that ✅ 3 in this issue is moot, then?
from azure-functions-kafka-extension.
Correct. It should be simple.
What could be a bit tricky is to handle byte[] as a single consumer and byte[][] as a batch consumer.
from azure-functions-kafka-extension.
Remember folks … mvp first, then we add on the "developer friendly" and nice to haves once developers start using it and requesting it. Hopefully by then we'll have a community of open source developers that will submit their own PRs :)
from azure-functions-kafka-extension.
What's the status of this issue? Closed, or still being worked on?
from azure-functions-kafka-extension.
Related Issues (20)
- Target scaler is not working (.NET) HOT 1
- Inconsistency between consumer and producer config HOT 1
- How to do exception handling in kafka output trigger if trigger fails to write to kafka HOT 2
- Distributed Tracing and kafka trigger
- Kafka trigger parameterization issues HOT 2
- Confluent Packages out of date causing runtime error
- Support for Bring your own certificates (.pfx)
- SchemaRegistryUrl attribute does not work with Java Azure Functions
- Enable support for rich datatypes in dotnet - isolated based apps using Kafka extension
- Kafka Trigger, Exception in Kafka subscriber, System.ObjectDisposedException at Confluent.Kafka.Impl.SafeKafkaHandle.ThrowIfHandleClosed
- Combine Key, Value, Header, TimeStamp in the same .Net object
- Make Kafka Output a first class typed citizen
- Support for librdkafka compression.codec and compression.type
- Kafka extension V3.9.0 issue HOT 1
- A lot of redundant logs produced
- Azure Function (Java ) to Confluent Kafka output binding error
- Typescript Support for Functions v4?
- Upgrading .NET version for Extension Projects
- Confluent SDK upgrade
- Scale to Zero Support for Kafka Extension
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-functions-kafka-extension.