azure-functions-kafka-extension icon indicating copy to clipboard operation
azure-functions-kafka-extension copied to clipboard

KafkaOutput Trigger throws an error if null value passed

Open Alpesh1984909090 opened this issue 2 years ago • 3 comments

I'm using kafka out trigger to push message but there is some business scenario which identify whether to pass message or not. But if we pass null to message it throws an error "Message value was not defined". Does this mean we cannot pass null or empty value in the message ? it force to pass something valid value if this is the case then how to handle the business scenario where there is no need to pass message.

Alpesh1984909090 avatar Mar 29 '23 22:03 Alpesh1984909090

Hi @Alpesh1984909090, Can you share more information on how you are setting the output value?

krishna-kariya avatar Apr 04 '23 05:04 krishna-kariya

Hi @krishna-kariya,

Kafka output trigger is out parameter so have to assign some default value, but there is business scenario wherein I need to determine whether to write to topic or not. So if there is nothing to write on the topic it throws this error.

alpeshdhanesha avatar Apr 04 '23 07:04 alpeshdhanesha

Hi @alpeshdhanesha, Can you share the function code? I tried setting the output message as null and it worked for me.

krishna-kariya avatar Apr 13 '23 11:04 krishna-kariya