Azure WebJob SDK Service Bus Documentation?

I am trying to use the Azure WebJob SDK, but I cannot find any documentation on it so that I can know what to expect without requiring tests.

I found this: http://azure.microsoft.com/en-us/documentation/articles/websites-webjobs-resources/ , but these are more tutorials, not documentation. They guide me through the most basic applications of the SDK, but they don’t go into details about situations without a happy journey.

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

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

Some examples of questions that I could not find the answer in the above links (although I may have missed this):

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

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

  • If this is PeekLock, what happens when the function (no exception) succeeds? Does it cause the message to β€œEnd” or do I need to call it manually?

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

  • What happens if my processing method throws an exception? Does this have an Abandon call in the message?

  • If my processing function takes longer than PeekLock, does the lock automatically resume, or do I need to do this manually?

  • Are there other automatic deserializations that I can use for ServiceBusTriggers besides String and BrokeredMessage?

  • Is it possible to connect a deserializer to my ServiceBusTrigger parameter? For example, if my messages are in protobuf format, can I teach the WebJob SDK so that it can be deserialized for me or should it be received as BrokeredMessage and manually deserialized?

+5
source share
1 answer

Please find answers to your questions.

  • SDK makes PeekLock
  • You will get BrokeredMessage
  • It will automatically complete
  • The SDK will provide you with BrokeredMessage and a string, but autocomplete will be the same
  • Call abandon
  • In fact, we call OnMessageAsync, which will handle the automatic update of the PeekLock timeout. (If this does not work, I think it will be a mistake).
  • Yes, you can use any POCO and do JSON serialization / deserialization well. We also support byte [].
  • Handle string, byte [], and POCO / JSON well for you (as well as BrokeredMessage). For something else, you need to use one of the other formats (for example, string or byte [] or BrokeredMessage) and process it yourself there.
+5
source

Source: https://habr.com/ru/post/1205535/


All Articles