2014-12-08 13 views
5

Ho WebJob in esecuzione continua utilizzando l'SDK WebJobs 1.0.0.
Ecco il codice di configurazione.Il messaggio QueueTrigger di Azure WebJob non viene eliminato dalla coda

public static void Main() 
{ 
    var config = new JobHostConfiguration(); 
    config.Queues.MaxDequeueCount = 1; 
    config.Queues.BatchSize = 1; 

    var host = new JobHost(config); 
    host.RunAndBlock(); 
} 

Ecco la mia firma della funzione lavoro.

public static void HuntVkusniyBlogRss([QueueTrigger("queue-rss")] string message, 
    DateTimeOffset expirationTime, 
    DateTimeOffset insertionTime, 
    DateTimeOffset nextVisibleTime, 
    string id, 
    string popReceipt, 
    int dequeueCount, 
    string queueTrigger, 
    CloudStorageAccount cloudStorageAccount, 
    TextWriter log) 
{ 
    ... 
} 

Mi aspetto che dopo aver eseguito correttamente la funzione, il messaggio venga eliminato dalla coda di attivazione. Ma sto facendo funzionare la funzione più di una volta.

La registrazione mostra che viene eseguito ogni volta che si verifica Prossimo intervallo e che il valore di dequeueCount aumenta di volta in volta.

UPD: Sembra che si verifichi un errore dopo l'esecuzione della funzione. Ecco log da webjob cruscotto:

[12/08/2014 13:10:47 > 51d5f4: INFO] Executing: 'Program.HuntVkusniyBlogRss' because New queue message detected on 'queue-rss'. 
[12/08/2014 13:10:53 > 51d5f4: ERR ] 
[12/08/2014 13:10:53 > 51d5f4: ERR ] Unhandled Exception: Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (404) Not Found. ---> System.Net.WebException: The remote server returned an error: (404) Not Found. 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T](HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase`1 cmd, Exception ex) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at Microsoft.WindowsAzure.Storage.Blob.CloudBlobSharedImpl.<DeleteBlobImpl>b__1b(RESTCommand`1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] --- End of inner exception stack trace --- 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.EndDelete(IAsyncResult asyncResult) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass4.<CreateCallbackVoid>b__3(IAsyncResult ar) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] --- End of stack trace from previous location where exception was thrown --- 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at Microsoft.Azure.WebJobs.Host.Protocols.PersistentQueueWriter`1.<DeleteAsync>d__6.MoveNext() 
[12/08/2014 13:10:53 > 51d5f4: ERR ] --- End of stack trace from previous location where exception was thrown --- 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at Microsoft.Azure.WebJobs.Host.Loggers.CompositeFunctionInstanceLogger.<DeleteLogFunctionStartedAsync>d__e.MoveNext() 
[12/08/2014 13:10:53 > 51d5f4: ERR ] --- End of stack trace from previous location where exception was thrown --- 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.<TryExecuteAsync>d__1.MoveNext() 
[12/08/2014 13:10:53 > 51d5f4: ERR ] --- End of stack trace from previous location where exception was thrown --- 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at Microsoft.Azure.WebJobs.Host.Queues.Listeners.QueueTriggerExecutor.<ExecuteAsync>d__0.MoveNext() 
[12/08/2014 13:10:53 > 51d5f4: ERR ] --- End of stack trace from previous location where exception was thrown --- 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at Microsoft.Azure.WebJobs.Host.Queues.Listeners.QueueListener.<ProcessMessageAsync>d__11.MoveNext() 
[12/08/2014 13:10:53 > 51d5f4: ERR ] --- End of stack trace from previous location where exception was thrown --- 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at Microsoft.Azure.WebJobs.Host.Timers.BackgroundExceptionDispatcher.<>c__DisplayClass1.<Throw>b__0() 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at System.Threading.ThreadHelper.ThreadStart_Context(Object state) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
[12/08/2014 13:10:53 > 51d5f4: ERR ] at System.Threading.ThreadHelper.ThreadStart() 
[12/08/2014 12:08:18 > 51d5f4: SYS ERR ] Job failed due to exit code -532462766 
[12/08/2014 12:08:18 > 51d5f4: SYS INFO] Process went down, waiting for 0 seconds 
[12/08/2014 12:08:18 > 51d5f4: SYS INFO] Status changed to PendingRestart 
[12/08/2014 12:08:23 > 51d5f4: SYS INFO] Run script 'HunterWebJob.exe' with script host - 'WindowsScriptHost' 
[12/08/2014 12:08:23 > 51d5f4: SYS INFO] Status changed to Running 
[12/08/2014 12:08:25 > 51d5f4: INFO] Found the following functions: 
[12/08/2014 12:08:25 > 51d5f4: INFO] Cookagg.HunterWebJob.Program.HuntVkusniyBlogRss 
[12/08/2014 12:08:25 > 51d5f4: INFO] Job host started 
+1

è la funzione un'eccezione? Puoi mostrarci i registri di esecuzione dal cruscotto webjobs? –

+0

Funtion non sta gettando eccezione. ho aggiunto i log da cruscotto –

+0

Quanto tempo impiega il tuo lavoro per eseguire? Sono più di 10 minuti? sumatori hai per questa coda? – b2zw2a

risposta

0

ho avuto lo stesso problema, ho avuto un conto deposito separato per i dati ei registri. Se ho usato lo stesso account di archiviazione per entrambi i bug stop.

1

Mi sono imbattuto in questo problema perché il contenitore non viene sempre creato automaticamente. Così, ho creato:

azzurro-jobs-host-output
azzurro-webjobs-hosts

+2

Ho questi contenitori e ancora ottengo lo stesso errore ... –

0

Vedi la versione webjobs SDK, se questo è inferiore alla 1.1.1.0, quindi controllare che sia con le ultime versione.

quindi dovrebbe essere come sotto, abbiamo avuto lo stesso problema con la versione 1.0.1.0 di webjobs sdk e l'aggiornamento a quello più recente risolto il problema.

  1. Microsoft.Azure.WebJobs.dll (nel nostro caso la versione corrente era 1.0.1.0 e abbiamo bisogno 1.1.1.0)
  2. Microsoft.WindowsAzure.Storage.dll (versione attuale è la 4.2.1.0, abbiamo bisogno (≥ 4.3.0 & & ≤ 5.0.2).
Problemi correlati