I thought I’d take advantage of the Red5 session at this year’s Flash on the Beach to check out what exactly Red5 is and whether I should bite the Java bullet and switch over from Flash Media Server. Unfortunately I couldn’t make it to the session, but a trusted colleague went in my stead and came back enthused by the merits of Red5. (here’s a link to a video of a similar session, and here’s a link to the FOTB session pdf)
First I downloaded and installed Red5 v0.8.0 Release Candidate 1. For whatever reason this didn’t work for me, so not a good start. After some head scratching and discussion I decided to try Red5 v0.7.0 Final instead. This version installed perfectly with very minimal bother, so I guess the lesson here is if you’re a beginner never install a Release Candidate 1 version! Once you’ve got Red5 up and running, you should be able to go here: http://localhost:5080/ to view the Red5 test page and example apps.
Installing Eclipse and the Java IDE
After enthusiastically playing with the demo apps provided for a bit, the next step was to download and install Eclipse so I could get up and running with Java.
Once I had the Eclipse framework the next step was to install a Java IDE on top of it. I opted for the “Eclipse IDE for Java EE Developers” because it seemed to be the most feature rich version of the IDE, and downloaded it from here.
Getting to grips with Java
The next problem was getting used to Java, a language I’ve never even looked at before. To do this, I strongly recommend looking in “Help/Help Contents” in Eclipse, then going to “Java Development User Guide/Getting Started/Basic Tutorial”. This is a really well written tutorial and gave me a great grounding in developing Java. If you get a bit stumped by the first hurdle in this tutorial regarding not being able to find the JDK (that you probably haven’t downloaded yet), go get it here. I went for JDK 6 Update 7 as the newer version was a Release Candidate Beta, and I’d already learned my lesson regarding RCs. 🙂
After going through that tutorial I was very pleased to see that the Java IDE I’d downloaded was just like my current favourite development tool: FlexBuilder, but way better! (why the hell didn’t Adobe implement Content Assist in FlexBuilder?!?) I was also pleased to have confirmation that Java is ridiculously similar to AS3, and looked forward to building my server-side apps in code way more similiar to AS3 than FMS’s AS1 equivalent.
Eclipse, Java and FlexBuilder
As my next move was going to be trying to build a simple Flash app that runs on Red5, I decided it would be handy to switch over from my standalone installation of FlexBuilder to the Eclipse plug-in version. You can download the plug-in version here, but you’ll need to sign in to the adobe site first.
Once I had this version of FlexBuilder installed I could quickly switch between Java and Flex Development perspectives within Eclipse and manage the whole application development process from within on IDE (which I think is very cool). When developing with FMS I’d got into the habit of editing my server-side code in Flash to take advantage of the code highlighting it provides for asc files, and my client side code in FlexBuilder, which wasn’t so cool. Also, because the server-side code is written in a dynamic language you can forget about any niceties like code hinting. 😦
Hello World, Hello Red5
So by now I was all setup to build my first Hello World red5 application. The next step then was to find a suitable tutorial on the web, and after trying out a few not so good tutorials I found one named Getting started with Red5 server. This tutorial would’ve been perfect had the application worked after going through all the code and all the permutations of the code in the trailing comments by other perplexed developers with a fine tooth comb. The comment that really threw me though was the one posted 10 months after the tutorial advising “You need to make a jar file from you java project and store it in the lib directory of your application”. It seems something pretty fundamental must’ve changed with Red5 over those 10 months if it was now necessary to include a jar file of your project… I checked through the other example apps in my installation of Red5 and they all did indeed contain a lib folder with a jar file of the application, plus 3 other jars: “logback-classic-0.9.8.jar”, “logback-core-0.9.8.jar” and “slf4j-api-1.4.3.jar”.
After having a bit of a play with FMS and Red5, I think its safe to say that the future of multi user Flash apps lays firmly in the lap of Red5, unless Adobe suddenly regain interest in developing FMS, which seems to now be on a back burner. The overall development experience provided by Red5 is (or at least will be) streets ahead of FMS. Plus not only can Red5 provide the same functionality as FMS, its a “fully fledged j2EE server” which allows you to build the rest of your application logic in Java and take advantage of the extensive code libraries available.
But… that said, I’m cautious to invest too much time developing reusable systems in Red5 at the moment as its not even out of Beta yet and may well still be subject to major structural revisions. If you view the Red5 roadmap you’ll see they’re currently at the version 0.8 release and (I’m hoping) not too far off the version 1.0 Public Release. Plus in version 0.9 they intend to provide more extensive documentation and to even support server-side AS3(!), so after this point I may need to reconsider whether I should be coding server-side in Java or AS3…
In short, Red5 is an awesome (and free!) tool, but I think I’m going to bide my time and continue to fiddle around with FMS until the full version 1.0 release. This should allow me to brush up on my client side multi user app code without investing too much energy on the server-side development. Plus FMS is after all just another technology that I can sell my services in, regardless of how comparatively poor the server-side language is.