Serialised Java Object Gateway

Let me start by saying that I’m no java expert. I’ve done bits and pieces with it over the years, but never done any major projects with it. Anyhow, a few days ago I posted on how we’ve been using CF7’s event gateway architecture to talk to a Java app we’ve currently got in development. It basically uses a serialized object I/O streams to pass objects between the client and the gateway. I’ve created a little demo app to shows how it’s done. It’s pretty rough, but it highlights the principles involved.

The Client is a modified version of a simple chat client. It will open a socket on the gateway and pass message objects back and forth. When the gateway receives a message from the client it passes it to the listener. The listener then hits a quote of the day web service to pass a random message back to the client.

I’ve also add a small feature that will allow you to upload a file to the gateway. It serializes the file by wrapping the file’s byte array in a sterilisable file wrapper object. Thanks to Johanes for the idea on this one. When the gateway receives the file wrapper it passes it to the listener cfc, which give’s it a new filename and passes it back to the client. 

To run it you will need to modify the ant build file to point to your cfusion/gateway/lib directory.  Build the project, setup your gateway type/instance and run the client…blah, blah, blah. Anyhow, the source code should give you the idea on how it works.

You can download it here.

Comments

very cool. good job.

Thanks Paul. I hope all's well. :)

News Feed

Recent comments

love it, tag/watch, [url="http://mediastop.info/...
rdnheczuftqsjoh, Compare chart electronic...
We're pretty much trying things to see what works...
Still going. I try to keep it agile, but I wouldn...
Yes, the mythical PO, what process are you using...