Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Dynamic Distributed Data Clustering on OSGi

DZone's Guide to

Dynamic Distributed Data Clustering on OSGi

· Java Zone
Free Resource

Build vs Buy a Data Quality Solution: Which is Best for You? Gain insights on a hybrid approach. Download white paper now!

If you’ve followed some of my past posts you’ll notice I try to keep my examples small and as simple as they need to be. If I were to describe my programming style its very much back to basics and I’m a huge proponent of simplicity.

I’ve whipped up a small example of how you can distribute data dynamically on OSGi using Hazelcast 1.4. I’ve really only scratched the surface of what you can do with this but thought I’d write up my first experiences with this light weight simple yet powerful framework.

Running the Example.

Download the cluster.zip example source code from:

https://sourceforge.net/project/showfiles.php?group_id=228168&package_id=302726&release_id=647048

Unzip the cluster.zip and start up 2 instances of eclipse 3.4. Open up the node01 and node02 directories in different instances of eclipse.

Click run light weight cluster in both instances of eclipse and Jetty should start up on port 9091 and 9092.

Open up two web browsers and in the first browser paste the following URL which will set cVal in a distributed Map on the first node.

http://localhost:9091/sample?cVal=Glenn

In the second browser paste the following:

http://localhost:9092/sample?check=true

If you see the following you have successfully setup a dynamically distributed data cluster.

Where’s the magic?

If you have a look at SampleServlet.java the magic is on line 27 and 32 where we get the map and set a value. Hazelcast makes it look like we are dealing with an ordinary map but the reality is that it possesses extraordinary distributed capability.

If you have any questions on the demo feel free to drop me a line (glenn.galang@gmail.com) or head on over to hazelcast.com.

 

From: http://ggalangblog.blogspot.com/

Build vs Buy a Data Quality Solution: Which is Best for You? Maintaining high quality data is essential for operational efficiency, meaningful analytics and good long-term customer relationships. But, when dealing with multiple sources of data, data quality becomes complex, so you need to know when you should build a custom data quality tools effort over canned solutions. Download our whitepaper for more insights into a hybrid approach.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}