I have a .NET Standard 2.0 project that defines Azure functions. I have a couple of BlobTrigger and QueueTrigger functions which work as expected. I am trying to replace the storage account QueueTrigger functions with ServiceBus topic trigger functions:
[FunctionName("CommandConsumer")]
public static async Task RunAsync([ServiceBusTrigger("commands", "active", Connection = "ServiceBus")]string commandJson, TraceWriter log)
{
log.Info($"C# ServiceBus topic trigger function processed message: {commandJson}");
}
This function never gets triggered even though upstream functions add messages to the topic successfully (I can see that I have 25 messages on the topic right now), and my console window shows a lot of messages like these:
[9/13/2018 7:13:29 PM] MessageReceiver error (Action=Receive, ClientId=MessageReceiver1commands/Subscriptions/active, EntityPath=commands/Subscriptions/active, Endpoint=p.servicebus.windows.net)
[9/13/2018 7:14:06 PM] MessageReceiver error (Action=Receive, ClientId=MessageReceiver1commands/Subscriptions/active, EntityPath=commands/Subscriptions/active, Endpoint=p.servicebus.windows.net)
[9/13/2018 7:14:42 PM] MessageReceiver error (Action=Receive, ClientId=MessageReceiver1commands/Subscriptions/active, EntityPath=commands/Subscriptions/active, Endpoint=p.servicebus.windows.net)
I've set the tracing to Verbose but I can't get any more details about this MessageReceiver error.
Thank you in advance!
Edit: here are the project's relevant package references:
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="3.1.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.0-beta8" />
<PackageReference Include="Microsoft.Azure.WebJobs.ServiceBus" Version="3.0.0-beta8" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.19" />
public async Task<bool> SubmitAsync<T>(IEnumerable<T> commands) where T : Command { var messages = commands.Select(c => new Message(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(c)))); await topicClient.SendAsync(messages.ToList()); return true; }- Florinator