Last active
October 25, 2022 15:46
-
-
Save dbarkol/7144527d3ca93c53aa52e2022f735733 to your computer and use it in GitHub Desktop.
The trigger and bindings used for the outbox processor function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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