Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Commit

Permalink
Finalizing dapr fixes (#756)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotalik committed Nov 5, 2020
1 parent 77ebc0d commit fae4732
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions samples/dapr/orders/Controllers/OrdersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<OrdersController> logger)
{
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion samples/dapr/orders/orders.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="0.8.0-preview01" />
<PackageReference Include="Dapr.AspNetCore" Version="0.11.0-preview02" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion samples/dapr/products/products.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="0.8.0-preview01" />
<PackageReference Include="Dapr.AspNetCore" Version="0.11.0-preview02" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion samples/dapr/store/Shared/ProductDisplay.razor
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 7 additions & 3 deletions samples/dapr/store/Startup.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -63,9 +64,12 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
var broker = endpoints.ServiceProvider.GetRequiredService<OrdersEventBroker>();
endpoints.MapPost("/orderprocessed", async context =>
{
var confirmation = await JsonSerializer.DeserializeAsync<OrderConfirmation>(context.Request.Body);
var confirmation = await JsonSerializer.DeserializeAsync<OrderConfirmation>(context.Request.Body, new JsonSerializerOptions()
{
PropertyNameCaseInsensitive = true
});
broker.Complete(confirmation);
}).WithTopic("orderprocessed");
}).WithTopic("messagebus", "orderprocessed");
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion samples/dapr/store/store.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="0.8.0-preview01" />
<PackageReference Include="Dapr.AspNetCore" Version="0.11.0-preview02" />
</ItemGroup>

</Project>

0 comments on commit fae4732

Please sign in to comment.