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

654
Vistas
How to set camel case using IAsyncCollector with System.Text.Json in Azure Functions?

I'm migrating Azure Functions v3 from Newtonsoft.Json to System.Text.Json and trying to get camelCase working globally.

For these:

  • SignalR
  • Service Bus output bindings
  • Cosmos DB

I was able to explicitly pass JsonSerializerOptions or set it globally (SignalR) but I'm not able to do so for IAsyncCollector.

Here is my code:

[FunctionName(nameof(SampleFunction))]
public async Task Run(
    [ServiceBusTrigger(ServiceBusQueue.QueueA)] string json,
    [ServiceBus(ServiceBusQueue.QueueB)] IAsyncCollector<Delivery> queueB,
    [ServiceBus(ServiceBusQueue.QueueC)] IAsyncCollector<Driver> queueC,
    ExecutionContext context)
{
        // ... do some work

        await queueB.AddAsync(objectB).ConfigureAwait(false);

        // ... do some more work

        await queueC.AddAsync(objectC).ConfigureAwait(false);
}

objectB and objectC ends up in service bus not with camel case. As a workaround I'm setting property names as case insensitive on the receiving function.

PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
PropertyNameCaseInsensitive = true

Any idea how can I get IAsyncCollector to serialize with camel case?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I recommend not using IAsyncCollector at all. The providers for IAsyncCollector don't have many knobs for configuration:

  • Serialization
  • Batching
  • Retries
  • Error handling

What's more, some implementations have changed these implementation details between releases without warning. For these reasons, I recommend never using IAsyncCollector and just using the APIs directly, where you have full control over all of these aspects. IAsyncCollector is a nice abstraction, but it's precisely that abstract nature that makes it unsuitable in the end.

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