Thursday, December 30, 2010

My stay at Dhamma Kuta for 11 days

I thought of writing a blog post what I have done during my year end vacation which is the best few days i have spend in my life. I am writing this post not to share an intellectual property, but if at least one person get benefit from this it will be the best thing for me. I will be keep on updating more information time to time so this post will be changed in coming days.I have applied the Vipassana 10 day meditation course (if you are a Sri Lankan when you hear this words meditation course you might get bored, but they simply use this in the western pattern so that western people will also understand things , just forget about the word...) in May and hopefully I was able to start it on 18th of December to 29th of December at Dhamma Kuta which is one of the Vipassana meditation center in Sri Lanka. For more information about the courses you can follow up them from their website[1], course schedules and how the things are rules etc. I will be posting something which does not exist in the web site.

My experience

When it comes to the experience best part will be what I have gain from doing Vipassana meditation, but it's not the correct time for this, I am continuing meditation at home and I will be posting on it in future, this part will be about my experience during the 10 days. I had a very strange, interesting and peaceful feeling during my stay at Dhamma Kuta which I haven't got in my life before. It was a very simple ten days I spend. Students are not suppose to talk to anybody (if you need something you simply have to talk to Dhamma helpers and you can talk to the teacher few word) and I consider that as one of the best experience. You will be given a simply cell which contains a bed, cloth rack and a small table. So whole few days were spend alone, simple food, and keep on meditating for more than 10 hours per day (don't get scared this can be done and thousands and thousands of people are attending these courses all over the world). So it was peaceful calm and quite 10 days in my life. But since it was away from the home and I was alone I felt like running away back home on the second day but hopefully I was strong enough to stay with a good determination.

What you should bring

I think this part will be useful if you are going for the first time, if you are a foreigner who is going to travel to Sri Lanka to attend to this course this part will be useful. This list is if you are going to Dhamma Kuta, but there will be slight changes if you are going to one of the other two centers in Sri Lanka. If you bring everything you want you will hardly speak to the management so you can keep the noble silence very effectively.
  • You need to bring cloths which is enough to survive 10 days and I would say simple easy to wear cloths would be fine. Since this part of the country is pretty cold you need to bring some other stuff which protect you from the cold environment. But the management is providing blankets for you, if it's difficult to bring blankets, still you will be good.
  • Slippers, bed sheet, pillow cover, torch will be very helpful.
  • Soap, brush, tooth paste etc.
  • I will update the list time to time when things get remind me.
This post is not completed yet.

[1]www.dhamma.org

Thursday, December 16, 2010

WSO2 product cluster with registry replication in Oracle

I recently notice an obvious mistake users doing when they configure WSO2 product cluster and use WSO2 G-Reg as the central repository for the replication among the cluster nodes. You can find a guide on how to set this up in an WSO2 Oxygen Tank tutorial [1] and there we are using Oracle as the database.

If you go through this you will see we are doing two registry mountings in all the cluster nodes, so every cluster node is having two database configuration, one for the local registry database configuration and one for the mount registry database configuration (configuration of the central registry database).

When it comes to Oracle, normally users are using a same database URL and differentiate among different databases by changing the user name and password. This works without any issue, but when it comes to mounting we are referring the URL of the database configuration and we expect you will put different URL values for two database configuration (local registry and config and governance mounting). So with Oracle users will simply not aware of this and use different username password and they get following error.

java.sql.SQLException: Total number of available connections are less than the total number of committed connections
at org.wso2.carbon.registry.core.jdbc.utils.Transaction$ManagedRegistryConnection.commit(Transaction.java:474)
at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.commitTransaction(EmbeddedRegistry.java:403)
at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.resourceExists(EmbeddedRegistry.java:594)
at org.wso2.carbon.registry.core.session.UserRegistry.resourceExists(UserRegistry.java:545)
at org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.setupMounts(RegistryCoreServiceComponent.
java:250)

So this error comes when someone try to mount from it's own database, if you use a configuration like below obviously we are throwing this exception.

<dbConfig name="wso2registry">
<url>jdbc:oracle:thin@qcdvcn1001-vip.dev.rsft.net:15000:DEV541</url>
<userName>wso2_esb</userName>
<password>wso2_esb</password>
<driverName>oracle.jdbc.driver.OracleDriver</driverName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<minIdle>5</minIdle>
</dbConfig>

<dbConfig name="esbMountRegistry">
<url>jdbc:oracle:thin@qcdvcn1001-vip.dev.rsft.net:15000:DEV541</url>
<userName>wso2_greg</userName>
<password>wso2_greg</password>
<driverName>oracle.jdbc.driver.OracleDriver</driverName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<minIdle>5</minIdle>
</dbConfig>

You can see above two URL's are same but username password are different.

So the solution for this issue is differentiate the URL by giving username in the database URL before the "@" sign. So the dbconfig elements of the cluster node registry.xml will looks like this.

<dbConfig name="wso2registry">
<url>jdbc:oracle:thin:wso2_esb@qcdvcn1001-vip.dev.rsft.net:15000:DEV541</url>
<userName>wso2_esb</userName>
<password>wso2_esb</password>
<driverName>oracle.jdbc.driver.OracleDriver</driverName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<minIdle>5</minIdle>
</dbConfig>

<dbConfig name="esbMountRegistry">
<url>jdbc:oracle:thin:wso2_greg@qcdvcn1001-vip.dev.rsft.net:15000:DEV541</url>
<userName>wso2_greg</userName>
<password>wso2_greg</password>
<driverName>oracle.jdbc.driver.OracleDriver</driverName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<minIdle>5</minIdle>
</dbConfig>

[1]http://wso2.org/library/tutorials/2010/11/setup-wso2-esb-cluster-wso2-greg


Tuesday, December 7, 2010

How to monitor and manage Apache Qpid C++ broker

In this blog post I am describing how to setup the Qpid C++ broker monitoring. First I have to say you that to do this you need to checkout the complete qpid source code which include Java/python/C++ etc. After successfully checking out make sure you have installed python in your machine.

Go to python directory and run the build command for python like this

python setup.py build

Go to command directory inside python directory and set the environment variable PYTHONPATH to the python directory (not to command directory).

Inside the command directory you can see set of python scripts which you can used to manage running Apache Qpid C++ broker.

Successfully doing all of these you can try running all the scripts with --help option and see all the possible options. With these scripts I have done Qpid monitoring and queue create/deleting topic creation/deletion like operation and i will be writing more about these things in few more blog posts.

Apache Qpid C++ broker persistency

I have been doing some Apache Qpid C++ broker work during last few weeks and I thought I should write some important things I learned during Apache Qpid configuration process. In this blog post I will be explaining how to configure persistent with Apache Qpid C++ broker.
To add persistence to Apache Qpid you have to use another project which maintained by RedHat and you first need to check out[1] the appropriate release tag which sync with the Apache Qpid release you are using.

First you should have a working Apache Qpid C++ broker build in your machine with a full checkout of the source of the release. If you are using a release please get a check out of the appropriate tag.

Now you have two checkouts Qpid complete checkout from the tag and message-store checkout from redhat sub version repository for the appropriate Qpid release.
Now go through the README file of the message store and install required softwares to build the message store successfully by running below commands.
cd
./bootstrap
./configure --with-qpid-checkout=
make
make install

Now point your LD_LIBRARY_PATH to /lib/.libs and go to the place where you have build Apache Qpid C++ broker and run the qpidd like below.

./qpidd --load-module msgstore.so

After you start this successfully you can use persistent queues with Apache Qpid C++ broker. You can run ./qpidd --load-module msgstore.so -h to see the available options with the loaded module msgstore.so.

To use the queue persistence please create durable queues, I will be writing few more blog posts on how to manage Apache Qpid C++ broker which will describe how to monitor C++ broker and how to create queues, topic and exchanges using python scripts provided in Qpid.

[1]http://anonsvn.jboss.org/repos/rhmessaging/store/tags/