- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Visual Studio 中有 2 个项目,一个 Web API 和一个具有 Azure 队列存储触发器函数的 Azure 函数项目。我正在使用 Azure 存储模拟器。两者都使用 UseUseDevelopmentStorage=true 作为连接字符串。队列客户端正在接收 201,我在存储模拟器中看到该消息。但触发函数永远不会被触发。我没有看到任何控制台错误。但是,如果我使用存储模拟器添加消息,则会触发触发器。所以触发功能确实可以工作,但只能通过模拟器。 QueueClient 代码正在运行,我收到 201 并在模拟器中看到该消息。我在本地完成这一切,我还没有在 Azure 中创建队列。我不明白这怎么会成为一个问题,但我想我应该补充一点。
我的队列客户端代码是
public async Task InsertCustomer()
{
var queueClient = new QueueClient(_configuration["StorageConnectionString"], "customer-items");
var myString = "Testing";
byte[] bytes = Encoding.Default.GetBytes(myString);
myString = Encoding.UTF8.GetString(bytes);
await queueClient.CreateIfNotExistsAsync();
//just here for debugging
var result = await queueClient.SendMessageAsync(myString);
}
URI 正在将其发送到 http://127.0.0.1:10001/devstoreaccount1/customer-items
队列触发器是
public static class InsertCustomerQueue
{
[FunctionName("InsertCustomer")]
public static void Run([QueueTrigger("customer-items", Connection = "AzureWebJobsStorage")] string myQueueItem, ILogger log)
{
try
{
log.LogInformation($"C# Queue trigger function processed: {myQueueItem}");
}
catch (Exception ex)
{
log.LogInformation(ex.ToString());
}
}
}
}
我正在以管理员身份运行 Visual Studio(2019 社区)和模拟器。这似乎是理所当然的事,但我无法弄清楚。
最佳答案
谢谢大家,现在明白了。我以为字符串需要是UTF-8,但事实证明它需要是base64编码的。
关于c# - Azure队列存储 Visual Studio 本地主机从QueueClient发送到毒队列的所有队列消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62400706/
有什么方法可以对 httpoison 的错误响应进行模式匹配吗?我就是这么做的 case HTTPoison.get!(url, [], []) do %HTTPoison.Error{reaso
我是一名优秀的程序员,十分优秀!