Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

249
Vistas
Azure Function .Net 5 Using ServiceBusTrigger

I'm using .net 5 azure function with ServiceBusTrigger. In previous versin. I was using a parametr MessageReceiver to tell azure that I compleated task. For that I used

await messageReceiver.CompleteAsync(message.SystemProperties.LockToken);

My problem is that i new version (.net5) unlike the previous version (.net core 3.1) is param in string (json) not in object (maybe it's the error but I don't know which object to use, object I tried was Microsoft.Azure.ServiceBus.Core.MessageReceiver).

But now i do not have the object so i can not call the method.

Does someone knows the answer? Thak you for your time.

Example of my code:

Function("TasksFunction")]
public async Task Run([ServiceBusTrigger("queue", Connection = "ConnectionString")] string message, string id, MessageReceiver messageReceiver, FunctionContext executionContext)
{
    try
    {
        await messageReceiver.CompleteAsync(message.SystemProperties.LockToken);
        await DoWorkAsync(messageReceiver, message);
    }
    catch (Exception e)
    {
        log.LogCritical(e);
    }
}
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Try to bind your message to Message type instead of string

public async Task Run([ServiceBusTrigger("queue", Connection = "ConnectionString")] Message  message, string id, MessageReceiver messageReceiver, FunctionContext executionContext)

Message has property SystemPropertiesCollection and use message.SystemProperties.LockToken

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda