Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
The trigger and bindings used for the outbox processor function
[FunctionName("OrderOutboxWorker")]
public static async Task Run(
[CosmosDBTrigger(
databaseName: "%CosmosDBDatabaseName%",
collectionName: "%CosmosDBCollectionName%",
ConnectionStringSetting = "CosmosDBConnectionString",
CreateLeaseCollectionIfNotExists = true,
LeaseCollectionName = "%CosmosDBLeaseCollectionName%")] IReadOnlyList<Document> input,
[CosmosDB(
databaseName: "%CosmosDBDatabaseName%",
collectionName: "%CosmosDBCollectionName%",
ConnectionStringSetting = "CosmosDBConnectionString",
SqlQuery = "select * from Orders r where r.orderProcessed = false")] IEnumerable<Document> ordersCreated,
[CosmosDB(
databaseName: "%CosmosDBDatabaseName%",
collectionName: "%CosmosDBCollectionName%",
ConnectionStringSetting = "CosmosDBConnectionString"
)] DocumentClient client,
[ServiceBus(
"%TopicName%",
Connection = "ServiceBusConnectionString",
EntityType = ServiceBusEntityType.Topic
)] IAsyncCollector<ServiceBusMessage> ordersToProcess,
ILogger log)
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment