Skip to content

Instantly share code, notes, and snippets.

@jmarmolejos
Created November 7, 2017 17:13
Show Gist options
  • Save jmarmolejos/af13aab68f07cd227fdaf7b9a0119bc2 to your computer and use it in GitHub Desktop.
Save jmarmolejos/af13aab68f07cd227fdaf7b9a0119bc2 to your computer and use it in GitHub Desktop.
var connectionString = "<your connectionstring that you won't be hardcoding like this>";
var queueName = "ProductsUpdate";
var deadLetterQueueName = QueueClient.FormatDeadLetterPath(queueName); // We'll get back to this in a bit
var client = QueueClient.CreateFromConnectionString(connectionString, queueName);
client.OnMessage(message =>
{
var updateRequest = message.GetBody<UpdateProductsRequest>();
productsService.updateInventoryProducts(updateRequest);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment