diff --git a/samples/dapr/orders/Controllers/OrdersController.cs b/samples/dapr/orders/Controllers/OrdersController.cs index 3a6301114..d7f055e68 100644 --- a/samples/dapr/orders/Controllers/OrdersController.cs +++ b/samples/dapr/orders/Controllers/OrdersController.cs @@ -10,7 +10,7 @@ namespace orders.Controllers [ApiController] public class OrdersController : ControllerBase { - [Topic("orderplaced")] + [Topic("messagebus", "orderplaced")] [HttpPost("orderplaced")] public async Task PlaceOrder(Order order, [FromServices] DaprClient dapr, [FromServices] ILogger logger) { @@ -49,7 +49,7 @@ public async Task PlaceOrder(Order order, [FromServices] DaprClient dapr, [FromS }; } - await dapr.PublishEventAsync("orderprocessed", confirmation); + await dapr.PublishEventAsync("messagebus", "orderprocessed", confirmation); logger.LogInformation("Sent confirmation for order {OrderId}", order.OrderId); diff --git a/samples/dapr/orders/orders.csproj b/samples/dapr/orders/orders.csproj index 3b072fc1a..75a55ca7c 100644 --- a/samples/dapr/orders/orders.csproj +++ b/samples/dapr/orders/orders.csproj @@ -5,7 +5,7 @@ - + diff --git a/samples/dapr/products/products.csproj b/samples/dapr/products/products.csproj index 3b072fc1a..75a55ca7c 100644 --- a/samples/dapr/products/products.csproj +++ b/samples/dapr/products/products.csproj @@ -5,7 +5,7 @@ - + diff --git a/samples/dapr/store/Shared/ProductDisplay.razor b/samples/dapr/store/Shared/ProductDisplay.razor index 316b19c2f..be631c69b 100644 --- a/samples/dapr/store/Shared/ProductDisplay.razor +++ b/samples/dapr/store/Shared/ProductDisplay.razor @@ -46,7 +46,7 @@ var task = Broker.GetOrderConfirmationAsync(orderId, cts.Token); - await Dapr.PublishEventAsync("orderplaced", new Order() + await Dapr.PublishEventAsync("messagebus", "orderplaced", new Order() { ProductId = Product.Id, OrderId = orderId, diff --git a/samples/dapr/store/Startup.cs b/samples/dapr/store/Startup.cs index 4d6459f09..17ad36d35 100644 --- a/samples/dapr/store/Startup.cs +++ b/samples/dapr/store/Startup.cs @@ -1,6 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; +using System.Text; using System.Text.Json; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; @@ -63,9 +64,12 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) var broker = endpoints.ServiceProvider.GetRequiredService(); endpoints.MapPost("/orderprocessed", async context => { - var confirmation = await JsonSerializer.DeserializeAsync(context.Request.Body); + var confirmation = await JsonSerializer.DeserializeAsync(context.Request.Body, new JsonSerializerOptions() + { + PropertyNameCaseInsensitive = true + }); broker.Complete(confirmation); - }).WithTopic("orderprocessed"); + }).WithTopic("messagebus", "orderprocessed"); }); } } diff --git a/samples/dapr/store/store.csproj b/samples/dapr/store/store.csproj index 271f1d9b4..019088fd1 100644 --- a/samples/dapr/store/store.csproj +++ b/samples/dapr/store/store.csproj @@ -5,7 +5,7 @@ - +