惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Help Net Security
Help Net Security
U
Unit 42
T
Tailwind CSS Blog
Y
Y Combinator Blog
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
云风的 BLOG
云风的 BLOG
博客园 - Franky
D
DataBreaches.Net
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
Cisco Talos Blog
Cisco Talos Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Blog — PlanetScale
Blog — PlanetScale
Know Your Adversary
Know Your Adversary
宝玉的分享
宝玉的分享
V
Visual Studio Blog
AWS News Blog
AWS News Blog
NISL@THU
NISL@THU
I
Intezer
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Privacy International News Feed
T
Tor Project blog
S
Securelist
Microsoft Security Blog
Microsoft Security Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Recorded Future
Recorded Future
C
Cisco Blogs
P
Palo Alto Networks Blog
Hacker News: Ask HN
Hacker News: Ask HN
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Recent Commits to openclaw:main
Recent Commits to openclaw:main
月光博客
月光博客
T
Threat Research - Cisco Blogs
N
News and Events Feed by Topic
AI
AI
Cyberwarzone
Cyberwarzone
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
Scott Helme
Scott Helme
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Martin Fowler
Martin Fowler
量子位
L
LINUX DO - 热门话题
H
Heimdal Security Blog
GbyAI
GbyAI
P
Privacy & Cybersecurity Law Blog
博客园 - 【当耐特】

博客园 - 青玄鸟

.NET 中优雅处理 Server-Sent Events 请求取消 vue3.0 + ts 实现上传工厂(oss与cos) .NET 代码整洁手册 Blazor项目通过docker和nginx部署为静态站点的步骤 Moq mock 方法返回null空指针异常 基于接口隔离原则的依赖注入实现 HttpClient with Stream HttpClient partial update HttpClient 基本使用 值对象的封装 只读集合类型属性实现 适配器模式 模板模式 最少知识原则 单例模式 抽象工厂 简单工厂、工厂方法、抽象工厂 工厂方法模式 使用 Visual Studio Code创建和执行T-SQL
Dapr 订阅者参数无法正确反序列化问题
青玄鸟 · 2023-06-13 · via 博客园 - 青玄鸟

问题描述

在使用Dapr的发布订阅组件时,遇到参数无法正确反序列化的问题,致使拿到的参数属性为默认值,入下图

问题排查

已经添加了UseCloudEvents,仍然没有正确反序列化

app.UseCloudEvents();
app.UseRouting();
app.UseAuthentication();

查看CloudEventsMiddleware中间件源代码

发现中间件在解析完参数后会把解析出的CloudEvent中的data字段中的原始参数写入httpContext.Request.Body,
因此需要在接受参数时,添加[FromBody]

此时即可拿到正确反序列化后的参数