Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure WebJob SDK Service Bus Documentation?

I am trying to use the Azure WebJob SDK but am unable to find any documentation on it so I can know what to expect without having to poke at it with tests.

I did find this: http://azure.microsoft.com/en-us/documentation/articles/websites-webjobs-resources/ but it is more tutorials rather than documentation. They walk me through the very basic usages of the SDK but they don't go into any detail about the non happy-path situations.

I also found https://github.com/Azure/azure-webjobs-sdk-samples which has some non-happy paths but there is very little information about Service Bus there.

In the absence of strong documentation, it would be nice if the source code was available (other than through reflection). Then I could dig a little and find the answers to my questions. At the moment, the only way I have found to answer any question is to write some tests but that quickly becomes tedious.

Some examples of questions that I haven't been able to find the answer for in the above links (though I may have missed it):

  1. If I have a method with a [ServiceBusTrigger("my-queue")] String parameter, does it PeekLock or ReceiveAndDelete?

  2. What about [ServiceBusTrigger("my-queue")] BrokeredMessage?

  3. If it is PeekLock, what happens on successful execution (no exception) of the function? Does it call Complete on the message or do I need to call that manually?

  4. Does the behavior change if I have a [ServiceBusTrigger("my-queue")] BrokeredMessage instead of a [ServiceBusTrigger("my-queue")] String?

  5. What happens if my processing method throws an exception? Does it call Abandon on the message?

  6. If my processing function takes longer than the PeekLock timeout, is the lock automatically renewed or do I have to do that manually?

  7. Are there any other automatic deserializations I can use for ServiceBusTriggers besides String and BrokeredMessage?

  8. Is it possible to hook up a deserializer to my ServiceBusTrigger parameter? For example, if my messages are in protobuf format, can I teach the WebJob SDK about it so it can deserialize for me or do I have to receive it as a BrokeredMessage and manually deserialize?

like image 801
Micah Zoltu Avatar asked Oct 26 '14 07:10

Micah Zoltu


People also ask

What is WebJob SDK?

The Azure WebJobs SDK is a framework that simplifies the task of writing background processing code that runs in Azure WebJobs. It includes a declarative binding and trigger system that works with Azure Storage Blobs, Queues and Tables as well as Service Bus.

Are Azure WebJobs deprecated?

Azure WebJobs are deprecated, but still in use. They are being phased out in favor of Azure Functions. Azure Functions is a more up-to-date and feature rich service which offers a greater degree of flexibility and control.


1 Answers

Please find the answers here for your questions.

  1. The SDK does PeekLock
  2. You will get the BrokeredMessage
  3. It will auto-complete
  4. The SDK will give you the BrokeredMessage vs. the string, but auto-completion is the same
  5. Call Abandon
  6. We actually call OnMessageAsync, which would handle renewing the PeekLock timeout automatically. (If that doesn't work then I think it would be a bug)
  7. Yes, you can use any POCO, and we’ll do JSON serialization/deserialization. We also support byte[].
  8. We’ll handle string, byte[], and POCO/JSON for you (as well as BrokeredMessage). For anything else, you’d need to use one of the other formats (like string or byte[] or BrokeredMessage) and handle it yourself from there.
like image 156
pranav rastogi Avatar answered Sep 28 '22 03:09

pranav rastogi