Azure / azure-functions-servicebus-extension

Service Bus extension for Azure Functions
MIT License
65 stars 36 forks source link

Not receiving any events when updating package WebJobs.Extensions.ServiceBus to version 5.0.0-beta.2 #158

Closed MarcoHuib closed 2 years ago

MarcoHuib commented 3 years ago

Hi,

I try to setup an Azure Function ServiceBusTrigger. Now first of all i use the default project that comes with visual studio it self. When setting up the connectionstring everything went well and I receive the events as expected.

Now i want to use the new version to be able to get a ServiceBusReceivedMessage class. Now i update the package "Microsoft.Azure.WebJobs.Extensions.ServiceBus" from version 4.1.0 to 5.0.0-beta.2 and add the extra param ServiceBusReceivedMessage (see code below) but i'm now not receiving anything anymore.

I was wondering if someone knows why? because I couldn't read much about this.

Thanks in advance.

namespace queue_trigger
{
    public static class queue_trigger
    {
        // This is working with the old package
        [FunctionName("queue_trigger")]
        public static void Run(
            [ServiceBusTrigger("queueOld", Connection = "ASB_CONNECTIONSTRING")]
            string myQueueItem,
            ILogger log)
        {
            log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}");
        }

        // This is not working with the new package
        [FunctionName("queue_trigger")]
        public static void Run(
            [ServiceBusTrigger("queueNew", Connection = "ASB_CONNECTIONSTRING")]
            string myQueueItem,
            ServiceBusReceivedMessage message,
            ILogger log)
        {
            log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}", message);
        }
    }
}

Some sources i read:

srikanthnd commented 3 years ago

Hi,

I try to setup an Azure Function ServiceBusTrigger. Now first of all i use the default project that comes with visual studio it self. When setting up the connectionstring everything went well and I receive the events as expected.

Now i want to use the new version to be able to get a ServiceBusReceivedMessage class. Now i update the package "Microsoft.Azure.WebJobs.Extensions.ServiceBus" from version 4.1.0 to 5.0.0-beta.2 and add the extra param ServiceBusReceivedMessage (see code below) but i'm now not receiving anything anymore.

I was wondering if someone knows why? because I couldn't read much about this.

Thanks in advance.

namespace queue_trigger
{
    public static class queue_trigger
    {
        // This is working with the old package
        [FunctionName("queue_trigger")]
        public static void Run(
            [ServiceBusTrigger("queueOld", Connection = "ASB_CONNECTIONSTRING")]
            string myQueueItem,
            ILogger log)
        {
            log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}");
        }

        // This is not working with the new package
        [FunctionName("queue_trigger")]
        public static void Run(
            [ServiceBusTrigger("queueNew", Connection = "ASB_CONNECTIONSTRING")]
            string myQueueItem,
            ServiceBusReceivedMessage message,
            ILogger log)
        {
            log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}", message);
        }
    }
}

Some sources i read:

it just works as expected. I tested this with the same example code. And used your code too just to be sure. The code above works too.

cachai2 commented 2 years ago

@Marcohuib are you still running into this issue?

MarcoHuib commented 2 years ago

Hi cachai2, I’m using the latest version and don’t have any issues anymore. This can be closed. thanks! 👍🏻