As noted in my last blog, I have been working on some open source binding components. We recently finished the RSS Binding Component and I wanted to get one of the demonstrations we did out here as an example of how you can use JBI to tie multiple protocols together that would normally be somewhat difficult to do. So in this demonstration I use the XMPP BC to send instant messages, and take that message and publish it as an RSS Feed. You can download the Netbeans project here. Prerequistes to build this application are as follows:
OpenESB Installer this comes with Netbeans, Glassfish with JBI Runtime, and JBI Components
Wildfire XMPP Server: for instructions on how to set up go here.
Spark XMPP IM Client: For instruction on how to set up go here.
XMPP Binding Component installed
RSS Binding Component installed
File Binding Component installed
BPEL Service Engine Installed
All of the Binding Components and the Service Engines come with the OpenESB installer. If you happen to be missing one you can find and download the component you need from here.
You will want to edit the WSDL's to fit your needs. First look at the fileWsdl.wsdl. You will notice that in the address section (file:address) you will be writting a file to you User Home/mag16AOC directory. You can edit this if you wish, and write the file where ever. Next look at the message (file:message) section of the WSDL and notice the file will be called mission100.xml. You can re-name the file if you wish.
Next look at the rssPublish wsdl, you will want to edit the feedUrl in the rss:address section to be specific to your machine (i.e. http://localhost:64801/feed/mag-16_aoc/mission_100). What this means is once you deploy this application and start sending instant messages, the messages will be published to the above link and you can view them using an RSS Reader (i.e. RSSOwl), or you can navigate to that link in a web page and view it there. Next look at the rssSubscribe wsdl. You will want to edit the rss:address section to be the same feedUrl you used above. What this does is subscribes to this feed and every time there is a new post you will get notified and the entry will be written to the file we described above.
Finally lets take a look at the xmppWsdl. You will need to edit the xmpp:address section to update the domain (i.e. localhost).
You can now clean and build the module in netbeans by right clicking on the project and selecting clean and build. With a successfull build you will want to right click on the XMPPtoRSSDemoCompApp and clean and build that. You are now almost ready to deploy these and test. You will first need to create a user for your spark client (This is assuming you have followed the instructions on how to setup Spark and Wildfire). Make sure you Wildfire server is running and start your Spark client. You will need to select "Accounts" and create a new user (i.e. bob, server is localhost). Once logged in you will want to pull up your Wildfire server Admin page and add a user. This user must be the same that is defined in the xmppWsdl (i.e. username = mag-16_aoc, passworkd mag-16_aoc), once this user is created you will want to add him as a contact in your buddy list for your Spark client. You are now ready to deploy and test.
Start the server in Netbeans ( Window --> Runtime --> Servers --> Right Click on Sun Java System Application Server 9 and select Start). Once the server is running you will see a Tab that says JBI, expand that and verify that under Binding Components you see the RSS Binding Component, XMPP Binding Component, File Binding Component, and under Service Engines verify you see BPEL SE. If those are in place you are ready to deploy your Composite Application. Right Click on the XMPPtoRSSDemoCompApp and select Deploy. Once successful you will see the buddy you added in your Spark client (mag-16_aoc) come online (i.e. turn green). You are now ready to send instant messages and have those messages published to an RSS Feed. Send a couple of messages and then navigate to the feedUrl you defined and verify the feed is being published. You can also verify your subscribe is working by navigating to the file and verifying that the file is being written to the location described in your fileWsdl.
So in short what we have done using JBI is the capability to "mash" two protocols together that could normally not happen, at least easily. This is a great example of how to take simple IM client and disseminate information to a large group of people. If you have any questions feel free to email me or use the mailing list on our project site for the RSS BC or XMPP BC
Monday, June 11, 2007
XMPP to RSS Demonstration
Posted by Chad Gallemore at 2:28:00 PM
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment