Java's Baby Steps on Microsoft Azure Cloud
This month Microsoft architect David Chou will be speaking at JavaOne about deploying Java applications to the Microsoft Azure cloud offering. Given that Azure is typically described as a Microsoft technology platform for .Net applications, InfoQ caught up with Mr. Chou to understand what can and can not be done on Azure with Java.
To start, Mr. Chou encouraged developers to think of Azure "as another Windows Server based environment that you can deploy code in... the model is kind of like one large zip file. If you can extract it into a flash thumb drive and if you can launch that application from that thumb drive then we will be able to run it in Azure." Theoretically, this means that as long as Java developers bundle a full JRE with their application and also write a small bootstrapping C# application, then they can run Java on Azure.
In practice, however, a typical Java application has to pass over some hurdles to work. According to Mr. Chou, applications that rely on Java's NIO capabilities or that use internal network communication like a JBoss cluster will not be able to cope with the Azure networking sandbox.
To illustrate these limitations, Mr. Chou described how he was able to get a Jetty-based application to run on Azure by:
- Using Visual Studio to create an Azure application skeleton;
- Swapping out the Jetty NIO ChannelConnector for a blocking IO ChannelConnector;
- Writing some logic in a C# WorkerRole to discover internally vs. externally facing ports and start Jetty with the right port arguments;
- Bundling the Jetty application container files and a JRE in the Java application's package;
- Commenting out anything in the Jetty configuration that tries to write to the file system (this is semi-optional, but working around the limitation requires more C# code).
Mr. Chou characterized Java development on Azure as:
This is step one towards a long journey. I equate it back to a time when I started working in Java and we didn't have an IDE. To build a client application we had to deal with AWT using TextPad or Notepad to write the application. It's kind of that stage right now: we can use Java and deploy a full-fledged Java application but there's a lot of room for improvement.
The next release of the 1.3 SDK in Q4, Mr. Chou assured developers, will ease some of the difficulty by loostening up the network sandbox restrictions and providing more administrative hooks for launching processes, as opposed to unzipping and boot strapping with a C# script.
When asked what kinds of customers are typically trying to deploy Java on Azure he described a project with Domino's Pizza where Microsoft provided help porting Domino's Tomcat-based application to Azure. In addition to migrating to an Azure compute resource, the applcation was also ported to use Microsoft cloud storage. The motivation was to be ready for up to 50% traffic spikes at dinner, especially on Fridays and on Super Bowl Sunday (the American football championship). When asked if the pilot project proceeded to production, he responded that the project was still a proof of concept.
In summary, Java developers who already have a copy of Visual Studio and who have a web application with relatively modest networking needs that doesn't rely much on the J2EE stack might experiment with deploying on the Azure cloud. Others may wish to wait for the 1.3 SDK release towards the end of the year. Anyone wishing to hear more can catch Mr. Chou's talk at JavaOne on Tuesday at 8am.
Mike Hartington Jul 26, 2015