My SOTR 2011 Presentation : AJAX Longpolling with BlazeDS

I'm rubbish I know... Takes me forever to actually post anything on my blog. Let me throw you a small bone.

Scotch on the Rocks 2011 was a marvelous event, even if I did manage to trash my ankle stepping off the train on the Wednesday night. Not that you care, but if you saw me hopping around, it turns out that I actually chipped a bit of bone off my ankle when I twisted my ankle. I'm sure you'll be ecstatic to know that after two and a half month I'm finally back to biking to work again. Anyway....


Getting the Flex-AJAX Bridge (FABridge) working in Chrome

Very brief blog post.

I've been working on my longpolling blog posts trying to resolve why I'm having problems with the dynamic channel creation with ColdFusion 9.0.1.

I've been trying to call my application from Firefox and Chromium on the same laptop. Firefox has been working beautifully, but Chromium 10 has not been playing nice.

Finally (I can be a stubborn fool sometimes) I decided to check from Internet Explorer, Safari and Firefox from my desktop all of which work first time, but Chrome just wasn't working.

So brain engages and I google "FABridge Chrome". The very first entry that turns up is this one on Tim's Blog called FABridge plays nice with chrome. In it Tom points out a bug in the javascript of FABridge.js, specifically the FABridge__bridgeInitialized function. This function does a browser test, but doesn't include Chrome. Add a check for Chrome and everything starts working just as it should!

For the record this is the change :

In FABridge.js if you change: if (/Explorer/.test(navigator.appName) || /Konqueror|Safari|KHTML/.test(navigator.appVersion)) to: if((!(/Chrome/.test(navigator.appVersion))) && ((/Explorer/.test(navigator.appName) || /Konqueror|Safari|KHTML/.test(navigator.appVersion))))

Thank you Tom! Much appreciated! Only wish I'd looked sooner!

AJAX Longpolling with ColdFusion and BlazeDS - Subtopics and building a messaging app

I'm sorry to say that I've been putting this post off. Why? Well to be honest I've been struggling with getting my head around how to actually use longpolling. Its all very well understanding the mechanics, but how can you use it effectively.

Part of the problem I've been having is the nature of sending messages and filtering them with BlazeDS. What I keep forgetting is that long poll messaging is "fire and forget". You don't send a message and expect an immediate response. You send a message and a response might be broadcast to all event listeners with a specific filter. If you want a request and response, call a webservice or a make an ajax request. Don't use long polling and event gateways.


Blog Roundup 30 April 2010

I'm rubbish! I really am... I promise and I promise to keep on top of Blog Round-ups, but I never seem to quite manage it.

I would really like to keep writing this round-ups ever week, but its quite an effort. Can I persuade anyone to co-author these posts with me? Leave me a comment. Drop me an email. Shout me on Twitter.

Anyway, on with the round-up.


AJAX Longpolling with ColdFusion and BlazeDS - Connecting and Messaging

In my last post on long polling I went through the basic set up of ColdFusion and BlazeDS before getting into too much code.

This part I want to get a basic connection and a couple of simple messages being sent and received.


AJAX Longpolling with ColdFusion and BlazeDS - Getting set up

I've spent some of my week this week fighting with JavaScript, BlazeDS and ColdFusion to get a working model for some ExtJS functionality that I'm currently building at work.

One of several pieces of functionality we'd like is to have is real time notifications of workflow changes. The way it was described was "we want to push alerts to the users".

I decided to have a look at how we actually addressed this "problem". We didn't really need to "push" alerts to users, so the solution was traditional polling or long polling.