Example name: Even simpler text chat
Description: A trivial demonstration of WebORB Messaging, in which multiple instances of this sample application use WebORB's built-in message queue, plus Publish and Subscribe, to share chat messages.
Prerequisites: Simple text chat
Client-side code: Browse  Download
Server-side code: [none]
Feature availability:
  • WebORB for .NET Development Mode
  • WebORB for .NET Community Edition
  • WebORB for .NET Enterprise Edition
Run example:
Key points:
  • The two screens above are two independent instances of the same EvenSimplerTextChat application. (They are as independent as if they were being run on two different computers, miles apart).
  • Each instance publishes to, and consumes from, the same message destination, which is named EvenSimplerTextChat. (It is not required that the application and destination name be the same).
  • This destination is (and must be) defined in [WEBORB]\WEB-INF\flex\messaging-config.xml, where [WEBORB] is the installation of WebORB into which you are deploying this application.
  • Notice (main.mxml, line 32) that event.message.body is an Array of objects, rather than being a single object.
   
Things to try:
  • While keeping this window open, open this page in a different browser window (perhaps on a different machine, running a different OS, and a different browser). Enter a new name, and send new chat messages. These new messages should appear in both instances of the EvenSimplerTextChat application in both browser windows.
  • Call friends in another city, and get them to open this page in their browsers. Enter chat messages. Verify that you can each see each others' chat messages.
  • Build this application on your development machine. Run it, and use the first window's File->New Windows menu to open a new instance of the client. It won't work (that is, chat messages will NOT be shared among clients). Why not? Because building the downloaded sample code does not create a EvenSimplerTextChat directory in your [WebORB]/Applications directory. YOu must do that yourself. Add that (empty) directory. Run the sample again. It still won't work. Why not? Because you still haven't added the necessary destination to your WebORB deployment's [WEBORB]\WEB-INF\flex\messaging-config.xml file. Add that destination, and run the application again. It still won't work. Why not? Because WebORB is not aware that you changed messaging-config.xml. You need to force IIS to re-start WebORB. The simplest way to do this is to add a meaningless whitespace character to (or delete one from) [WebORB]/Web.config. That will "bounce" IIS. Now (finally!) the sample should work on your local machine.
See also:
Screencast: [none]
Errata:
  • None yet known.