CaseOnline.Azure.WebJobs.Extensions.Mqtt icon indicating copy to clipboard operation
CaseOnline.Azure.WebJobs.Extensions.Mqtt copied to clipboard

Unable to configure binding 'message' of type 'mqttTrigger'

Open JakobBlomberg opened this issue 4 years ago • 9 comments

Hi, When using this extension with an Azure Function v2 or v3 in Visual Studio I get the following error message when running locally: "The 'TestSubscriberFunction' function is in error: Unable to configure binding 'message' of type 'mqttTrigger'. This may indicate invalid function.json properties. Can't figure out which ctor to call."

The function seems to work anyway because I do get data from the MQTT Broker I connect to but I am not sure if this error message is causing something else to not work within the Function framework.

JakobBlomberg avatar Jul 02 '20 20:07 JakobBlomberg

I have the same problem.

mikkowsx avatar Oct 15 '20 12:10 mikkowsx

I have the same problem. The problem occurred after I updated the MQTTnet NuGet package. It's because there are breaking changes in the MQTTnet. As long as you keep the NuGet package of MQTTnet to version 3.0.8 it should work.

StannieV avatar Nov 13 '20 08:11 StannieV

Hi

When I ran my project in the Azure function runtime emulator I got the above error message.

I then downloaded source from github and built from scratch "ExampleFunctions" (commenting out all bar SimpleFunction and some other tweaking of connectionstring & topic) and still got the same error.

"The 'SimpleFunction' function is in error: Unable to configure binding 'message' of type 'mqttTrigger'. This may indicate invalid function.json properties. Can't figure out which ctor to call."

Code appears to work but message is worrying. Any suggestions on how to fix greatly appreciated.

@KiwiBryn

KiwiBryn avatar Dec 24 '20 04:12 KiwiBryn

Has anyone resolved this issue?

taylorjimbo avatar Jul 28 '21 00:07 taylorjimbo

Unfortunately I haven't resolved it, but +1 for the it works anyway both locally and when deployed.

I don't think it is a MQTTnet issue as suggested above, I tried using older versions and still no joy. I am now happily using the latest version of MQTTnet, with fixes as per PR #117

sqlgreen avatar Jul 28 '21 12:07 sqlgreen

I spent some time looking into this, by grabbing the repo and debugging the library code. Implementing custom triggers and the attribute is a fairly complicated undertaking.

As there is really no impact once deployed, I suspect that there I some difference in the Visual Studio tooling around function apps. As such it can be ignored.

justoke avatar Jul 28 '21 18:07 justoke

Still the same error, @sqlgreen Did it work for you with the new fixes of PR #117 ?

rajkiran-planb avatar Aug 12 '21 12:08 rajkiran-planb

@rajkiran-planb sorry I wasn't very clear.

I still have the error Unable to configure binding 'message' of type 'mqttTrigger'. but now ignore it as it has no real impact, other than a scary message when running locally

One previous post from StannieV suggested a version of MQTTnet caused this issue, but in my testing, using either older or newer versions of MQTTnet do not solve the binding message errors.

If you do want to use the latest MQTTnet there are indeed some breaking changes, but the fixes are in PR 117. However these MQTTNet changes and associated fixes have no impact whatsoever on the annoying binding message

sqlgreen avatar Aug 12 '21 13:08 sqlgreen

A pull request is pending which should resolve this issue. https://github.com/keesschollaart81/CaseOnline.Azure.WebJobs.Extensions.Mqtt/pull/162

I tried the code change from the pull request and it appears to resolve the issue.

justoke avatar Oct 21 '21 19:10 justoke