Azure / azure-webjobs-sdk

Azure WebJobs SDK
MIT License
739 stars 358 forks source link

QueueTrigger alone will not be found by the host if no [Singleton] is installed #1948

Open jsgoupil opened 6 years ago

jsgoupil commented 6 years ago

When using only a QueueTrigger, I receive the following message

public void MyMethod([QueueTrigger("qn-abc")] int value)
{
}

No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.).

If I add [Singleton] on the method, I get the following Found the following functions: Bolt.WebJobs.Continuous.ContinuousMethods.MyMethod

If I add another method such as

[Singleton]
public void BlobTrigger([BlobTrigger("test")] string blob, ILogger logger)
{
}

And remove the [Singleton] from my first method, now both methods are found.

Found the following functions: Bolt.WebJobs.Continuous.ContinuousMethods.BlobTrigger Bolt.WebJobs.Continuous.ContinuousMethods.MyMethod

This is with package 3.0.0

mattwoberts commented 6 years ago

Yup - confirmed for me too.

I have a project with 4 queue trigger functions, each defined it it's own class.

When I start, no job functions are found. If I add [Singleton] to just one of them, then they're all found.

wimagee commented 6 years ago

Seeing the same thing with 3.0.1 - I've added dummy singleton queue triggers.