3
votes

Can we write Azure Webjobs with Queue Triggered jobs on Java, tried to search a lot and found only .Net related code example (https://azure.microsoft.com/en-in/documentation/articles/websites-dotnet-webjobs-sdk-storage-queues-how-to/)

If yes can any one direct me to the resources.

Note: Was able to run webjob in java which was triggered by schedule, for this had to create executable jar and create a batch file which runs the jar and zip this two files (bat and jar).

3

3 Answers

3
votes

While we don't have plans to add Java support directly to the core WebJobs SDK, we do have a tracking item here for Java Support in Azure Functions. Feel free to chime in on that issue.

All the work we're doing for cross language is being done in Azure Functions, which builds on the WebJobs SDK foundation. Azure Functions currently supports QueueTrigger (and all the other triggers) for C#, Node.js, PowerShell, PHP, Python, BAT, Bash.

2
votes

I don't think so, the QueueTrigger is written in .Net code and only exposed as a .NET attribute. The code is on github at https://github.com/Azure/azure-webjobs-sdk. You can request it on the github site, I don't know where it would fall into their priorities.

0
votes

If your task can live with slight delays, you can use the schedule trigger to poll the queue (say with a 30 secs schedule), and go back to sleep if there is nothing to do. If there is something on the queue, keep on processing till the queue gets empty.

I know it is not pretty, but might work in certain scenarios.

Java client for Azure queue storage is documented here: https://azure.microsoft.com/en-in/documentation/articles/storage-java-how-to-use-queue-storage/