错误时调用azure.createQueueService()

编程入门 行业动态 更新时间:2024-10-27 01:36:01
本文介绍了错误时调用azure.createQueueService()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我测试了一些code有关节点和天蓝色。根据code段@ github/WindowsAzure/azure-sdk - 对于节点

VAR queueService = azure.createQueueService();queueService.createQueueIfNotExists(任务队列,功能(错误){如果(!错误){    //队列存在}});

在我的code我想: -

VAR AZURE =要求('蔚蓝');功能TestQueue(QUEUENAME){    变种queueService = AZURE.createQueueService(); //在该行发生错误    queueService.createQueueIfNotExists(QUEUENAME,功能(错误){        如果(!错误)        {            的console.log(OK);            RESPONSE.send(200,{消息:OK,状态:OK});        }        其他        {            的console.log(错误:+误差);            RESPONSE.send(200,{消息:错误状态:错误});        }    });}

错误消息: -

NoMatchError:提供的设置{blobendpoint: undefined.blob.core.windows .NET ,tableendpoint: undefined.table.core.windows。净,queueendpoint: undefined.queue.core.windows } 未完成

问题是如何创造queueService?

顺便说一下,以下code做工精细。但是这是不够的我。我需要排队的服务也。

VAR AZURE =要求('蔚蓝');变种SERVICEB_BUS_SERVICE = AZURE.createServiceBusService();功能createQueue方法(QUEUENAME){        SERVICEB_BUS_SERVICE.createQueueIfNotExists(QUEUENAME,功能(错误){            如果(!错误){                的console.log('%s的队列创建或存在:',QU​​EUENAME);                RESPONSE.send(200,{消息:OK,状态:OK})            }            其他            {                的console.log('%s的队列创建错误。',QUEUENAME);                RESPONSE.send(200,{消息:错误状态:错误})            }        })}

解决方案

基本上你得到这个错误是因为没有指定的帐户名/键。尝试是这样的:

VAR AZURE =要求('蔚蓝');TestQueue('testqueue1');功能TestQueue(QUEUENAME){    变种queueService = AZURE.createQueueService('ACCOUNTNAME','accountkey'); //在该行发生错误    queueService.createQueueIfNotExists(QUEUENAME,功能(错误){        如果(!错误)        {            的console.log(OK);        }        其他        {            的console.log(错误:+误差);        }    });}

I am testing some code about node and azure. According the code snippet @ github/WindowsAzure/azure-sdk-for-node

var queueService = azure.createQueueService(); queueService.createQueueIfNotExists('taskqueue', function(error){ if(!error){ // Queue exists } });

In my code I tried:-

var AZURE = require('azure'); function TestQueue(QueueName) { var queueService = AZURE.createQueueService(); // error occurred at this line queueService.createQueueIfNotExists(QueueName, function(error){ if(!error) { console.log("ok"); RESPONSE.send(200, { Message: "ok", Status: "ok" }); } else { console.log("error: "+error); RESPONSE.send(200, { Message: "error", Status: "error" }); } }); }

Error message:-

NoMatchError: The provided settings {"blobendpoint":"undefined.blob.core.windows","tableendpoint":"undefined.table.core.windows","queueendpoint":"undefined.queue.core.windows"} are not complete.

Question is how to create queueService?

By the way, following code work fine. But it is not enough for me. I need queue service also.

var AZURE = require('azure'); var SERVICEB_BUS_SERVICE = AZURE.createServiceBusService(); function createQueue(queueName) { SERVICEB_BUS_SERVICE.createQueueIfNotExists(queueName, function(error){ if(!error){ console.log('%s queue created or exist: ',queueName ); RESPONSE.send(200, { Message: "ok", Status: "ok" }) } else { console.log('%s queue creation error.',queuename ); RESPONSE.send(200, { Message: "error", Status: "error" }) } }) }

解决方案

Basically you're getting this error is because no account name/key is specified. Try something like this:

var AZURE = require('azure'); TestQueue('testqueue1'); function TestQueue(QueueName) { var queueService = AZURE.createQueueService('accountname', 'accountkey'); // error occurred at this line queueService.createQueueIfNotExists(QueueName, function(error){ if(!error) { console.log("ok"); } else { console.log("error: "+error); } }); }

更多推荐

错误时调用azure.createQueueService()

本文发布于:2023-11-27 19:33:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639325.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:时调   错误   createQueueService   azure

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!