Skip to content

Allow Object Property Binding for Queue Names #443

Description

@erenken

I have a POCO that looks like this:

class ExportEvent
{
    int EventType {get; set;}
    string CompanyCode {get; set;}
}

I am biding to an EventHub like so:


public async static Task Run([EventHubTrigger("%exportHubName%", Connection = "hub-export-events", ConsumerGroup = "exports")]ExportEvent exportEvent,
            ExecutionContext executionContext,
            ML.ILogger logger,
            TraceWriter traceWriter)

I would like to be able to this for an out binding:

public async static Task Run([EventHubTrigger("%exportHubName%", Connection = "hub-export-events", ConsumerGroup = "exports")]ExportEvent exportEvent,
            [Queue("export-{CompanyCode}", Connection ="exportConnection")] IAsyncCollector<ExportEvent> exportQueue,
            ExecutionContext executionContext,
            ML.ILogger logger,
            TraceWriter traceWriter)

If this is fired from an Event Hub with this data:
{ "EventType": 1, "CompanyCode": "MyCompany" }

I should then be able to call:
await exportQueue.AddAsync(exportEvent);

And it would put that json on the queue "export-mycompany", and if that Queue didn't exists it would create it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions