JDBennett
JDBennett

Reputation: 1505

Run local Azure Function with NService Bus Service Bus Trigger

I am trying to test and run an Azure function locally using NService bus and a Service Bus Trigger.

Using Azure Functions Core Tools you can invoke a non-http trigger function using the administrator endpoint.

I am able to "hit" the endpoint but NService bus is throwing an exception because the NService bus messages include several "message headers" - one of which is thte NServiceBus.EnclosedMessageTypes header that specifies the message contract.

Using postman - I am posting the payload required by the administrator endpoint:


{
    "input": "/{my escaped event object}/"
}

I tried setting the http headers on the postman post:

    Request Headers
    Content-Type: application/json
    NServiceBus.EnclosedMessageTypes: Namespace.Models.MyEvent
    User-Agent: PostmanRuntime/7.42.0
    Accept: */*

I get an exception:

    System.Exception: The System.Text.Json message serializer requires message types to be defined.

I am using the System.Text.Json serializer - the type cannot be inferred and needs to be included in the message. 

The question is how do I test a full Nservice bus message through the Http Admin tool with Azure Core tools?

Upvotes: 0

Views: 63

Answers (0)

Related Questions