Skip to main content

Configure WSO2 ESB with XMPP transport

This post explains main steps which required to configure WSO2 ESB with XMPP transport support. For this I am using Openfire, Instant Messaging chat server that implements the XMPP protocol. Here I am working on Linux OS and you have to change commands according to your OS.
  • Then Extract the openfire distribution and go to the folder "openfire/bin".
  • Now you can run the openfire server using following command in command prompt
    ./openfire start
  • After that you can setup openfire. For that you have to use type following URL in your browser.
  • With this setup you can add server settings including domain, database settings, Profile Settings, and Administrator Account. Following are the settings with my setup.
    Domain – localhost
    database settings – Embedded database
    Profile Settings – Default
    Administrator Account – Username: admin Password: admin
  • Now the openfire setup is completed and if you want you can do any configuration changes by logging in to openfire admin console. (For this you need to restart openfire server)
  • Lets configure ESB with XMPP transport by editing axis2 xml file in ESB. For this you have to add following configuration to ESB_HOME/repository/conf/axis2.xml (You need to change xmpp credentials according to xmpp your account)
    <transportReceiver name="xmpp" class="org.apache.axis2.transport.xmpp.XMPPListener"> 
    
    <parameter name="MyServer"> 
    
    <parameter name="transport.xmpp.ServerUrl">localhost</parameter> 
    
    <parameter name="transport.xmpp.ServerAccountUserName">admin</parameter> 
    
    <parameter name="transport.xmpp.ServerAccountPassword">admin</parameter> 
    
    <parameter name="transport.xmpp.ServerType">transport.xmpp.ServerType.Jabber</parameter> 
    
    </parameter> 
    
    </transportReceiver> 
    
    <transportSender name="xmpp" class="org.apache.axis2.transport.xmpp.XMPPSender"> 
    
    <parameter name="transport.xmpp.ServerUrl">localhost</parameter> 
    
    <parameter name="transport.xmpp.ServerAccountUserName">admin</parameter> 
    
    <parameter name="transport.xmpp.ServerAccountPassword">admin</parameter> 
    
    <parameter name="transport.xmpp.ServerType">transport.xmpp.ServerType.Jabber</parameter> 
    
    </transportSender> 
    
  • Then add smack-3.0.4.jar and smackx-3.0.4.jar libs to ESB_HOME/repository/components/lib folder.
  • Thats all about initial configuration. Start the ESB server and check the status.

Comments

  1. Good instructions, they are working for me but where to find example on the usage?
    I would like to:
    - intercept messages written in a chat room, transform them with an xslt and send as soap message
    - Receive a soap message, unwrap the content and publish it on a char room.

    thanks in advance
    Vincenzo

    ReplyDelete
  2. Hi,

    First of all sorry for the late reply. I wanted to share this post because it can be helpful if someone writing a carbon component which using xmpp as the transport medium for any purpose. These instruction not targeting any specific sample.But of course if you are interested you can write your own carbon components based on carbon platform and contribute to the community too.

    Cheers,
    Ranga.

    ReplyDelete
  3. Hi,

    thanks for the instructions!

    So far I've set up a WSDL based proxy and could configure XMPP as a transport.
    The endpoint looks like: xmpp://wso2@null/services/GlobalWeather
    How to configure the correct server instead of "null"?
    In openfire the ressource is shown as: wso2@robovm/soapserver326927531 such that I can send an IQ to that ressource but not to the WSo2 endpoint giving me an IQ reply with "feature-not-implemented".

    Is there any possiblity to trace what's going on inside WSo2 when an XMPP arrives (if it really arrives?).

    Another - not that important question - would be how to use the newest smack version 4.0?

    Thanks,

    Chris.

    ReplyDelete

Post a Comment

Popular posts from this blog

How to install IBM WebSphere MQ on Ubuntu (Linux)

Following are the steps to install IBM WebSphere MQ version 8 on Ubuntu 14.04. 1) Create a user account with name "mqm" in Ubuntu. This should basically create a user called "mqm" and usergroup called "mqm" 2) Login to "mqm" user account and proceed with next steps 3) Increase the open file limit for the user "mqm" to "10240" or higher value. For this open "/etc/security/limits.conf" file and set the values as bellow. mqm       hard  nofile     10240 mqm       soft   nofile     10240 4) Increase the number of processes allowed for the user "mqm" to "4096" or higher value. For this open "/etc/security/limits.conf" file and set the values as bellow. You will need to edit this file as a sudo user. mqm       hard  nproc      4096 mqm       soft   nproc      4096 5) Install "RPM" on Ubuntu if you already don't have it. sudo apt-get install rpm ...

Creating a Simple Axis Service(.aar file) and Deploy it in WSO2 Application Server

In this post I am explaining how to Create a Simple Axis Service(.aar file) and Deploy it in WSO2 Application Server using a simple sample. And also at the end I am describing how to do the same thing with creation of a Jar Service. Lets assume "sample-home" as our parent directory and inside that we can create following folder structure. With this folder structure we can include our external libraries (jar files) inside lib folder and  the "services.xml" file inside "META-INF" folder. Following is the sample services.xml definition which I used with this sample creation. < service name = "HelloService" > < Description > This is a sample service to explain simple aar service </ Description > < messageReceivers > < messageReceiver mep = "http://www.w3.org/2006/01/wsdl/in-out" class = "org.apache.axis2.rpc.receivers.RPCMessageReceiver" /> </ messageReceivers > < parame...

Beautiful Trincomalee : One of the stunning places to visit in Sri-Lanka

Recently my self and few of my friends traveled to the ancient city of Trncomalee which is situated in eastern province and lies on the east cost of the little island. In ancient times it was identified as Gokanna and it was one of the major see ports in the international trading history of Sri Lanka. The city is home to the famous ancient Koneswaram Temple and it is said that this is the capital city of king Ravana . This was my first travel to this ancient city and I would say that, it is one of the best places to visit in Sri Lanka. There are lot of places to visit there including Konesvaram Temple, Dutch Fort, Nilaveli Beach, Marble Beach and Pigeon Island . Nilaveli beach is considered to be one of the best beaches in Sri Lanka and Knee deep shallow seas spreads out hundreds of meters towards the sea. That provides ideal and pure conditions for sun bathing. Some of the pictures taken(by me and my friends) trough out the tour is listed bellow as a evidence to the stunning...