Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

251
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda