我测试了一些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的队列创建或存在:',QUEUENAME); 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()
发布评论