[英]azure function service bus output message properties
有一個未解決的問題,請訪問https://github.com/Azure/Azure-Functions/issues/454
一些客戶似乎找到了解決方法。 也許你可以嘗試他們在這里提到的方法https://github.com/Azure/Azure-Functions/issues/454#issuecomment-375154151
@l --''''''---------“”“”“”“”“”“”你需要訪問Microsoft.Azure.ServiceBus.Message
類。 假設你有一些名為messageBody
json
並且您有一些要添加到郵件中的屬性列表。 您可以像下面的示例一樣實現它。
確保using Microsoft.Azure.ServiceBus;
添加using Microsoft.Azure.ServiceBus;
var myCustomProperties = new List<Dictionary<string,string>>();
var message = new Message(Encoding.UTF8.GetBytes(messageBody));
foreach (var userProperty in myCustomProperties)
{
message.UserProperties.Add(userProperty.Key, userProperty.Value);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.