The Source for Java Technology Collaboration


XMPP Component Service Example

This XMPP example shows how to create and use a component connection using the XMPP Resource Adaptor. The source code is located at https://mobicents-examples.dev.java.net/source/browse/mobicents-examples/xmpp-example/#dirlist

  • Step 1: You need a XMPP Server installed and configured to accept component connections. If you already have one then skip to Step 2, else let's install and setup JiveSoftware Wildfire, an open source XMPP Server.
  • Step 2: You need a XMPP client running on the server installed. If you already have that then skip to Step 3, else let's install Psi, an open source XMPP client.
    • Download Psi at http://psi-im.org/download and install it.
    • Run Psi "Account Setup", choose to "Add" a new account.
    • Give a name to this account, CHECK the "Register new account" box and choose "Add".
    • Setup your Jabber ID using your XMPP Server Name as the domain (ex: eduardomartins@myservername) and password, then click "Register", it should confirm the account creation on the XMPP Server.
    • Click "Save" and "Close" to terminate the account setup.
  • Step 3: Configure the XMPP Component Service - Part 1 (file component.properties)
    • Property "org.mobicents.slee.service.xmppcomponent.SERVERHOST" must be set to the XMPP Server's hostname or IP.
    • Property "org.mobicents.slee.service.xmppcomponent.SERVERPORT" must be set to the XMPP Server's port you set for External Components.
    • Property "org.mobicents.slee.service.xmppcomponent.SERVICENAME" must be set to the XMPP Server's service name for components. In Wildfire it's the same as the COMPONENTNAME property, other XMPP Servers like Jabber XCP usually set it different.
    • Property "org.mobicents.slee.service.xmppcomponent.COMPONENTNAME" is the domain name for your component. Please not that some XMPP servers, like Wildfire, only accept sub domains of the Server name (ex: mobicents.myservername) noted on Step 1.
    • Property "org.mobicents.slee.service.xmppcomponent.COMPONENTSECRET" must be set to the XMPP Server's secret you set for External Components.
    • Property "org.mobicents.slee.service.xmppcomponent.CONNECTIONID" is the XMPP RA connection Id for your component connection. You can leave the default value set.
  • Step 4: Configure the XMPP Component Service - Part 2 (file servicediscovery.properties) * This file is used to setup service discovery info for the component connection, you can use the default values if you don't know the XMPP Service Discovery details.Step 4: Run Mobicents
  • Step 5: Run Mobicents
  • Step 6: Go to ${MOBICENTS_EXAMPLES}/lib/xmppra and run ant deploy
  • Step 7: Go to home dir of this examples and run ant deploy
  • Step 8: Check that everything is OK on the XMPP Server
    • Return to the XMPP Server's admin page, select "Sessions" and "Component Sessions". You should see your component connection.
  • Step 9: Configure and deploy XMPP Test Sbb, the Sbb that will in fact use the component connection
    • Open XMPPTestSbb.java and change "myComponent" String on line 24 to the same value of property "org.mobicents.slee.service.xmppcomponent.COMPONENTNAME" on Step 3.
    • Deploy the test service with "“ant deploy".
  • Step 10: Start a XMPP conversation with the SBB
  • In the running (and configured) XMPP Client add the contact "testsbb@" + the component name.
  • Chat with that contact, you should have your messages replied with a word count.

Author: Eduardo Martins and Neutel Rodrigues Last Update: 06 Apr 2006

-- Main.ivelin - 27 Oct 2005

Topic MobicentsExamplesXMPPSBB . { Edit | Ref-By | Printable | Diffs r5 < r4 < r3 < r2 < r1 | More }
 XML java.net RSS

Revision r5 - 25 Jan 2007 - 22:05:14 - Main.baranowb
Parents: MobicentsExamples