Sunday, February 6, 2011

Installing ZeroMQ and Java bindings on Ubunu 10.10

For some times now, I'm following the slow evolution of AMQP toward it's 1.0 release. In the trip, one traveler decided that the road was far too long, and complex, and choosed to take its independence: ZeroMQ is living its own adventure for some times now. And their choices are intersting, really focused and sharp, so I needed to see what can be done with that message system, and a bit of Scala.

So the first part was to install ZeroMQ and its Java binding into my computer, a Linux Ubuntu 10.10. It was quite easy, but as I didn't find a single post for the whole thing, I write that one as a memo, when in some days I will try to do it again and won't be able to remind the precise steps :)

Step 1: install recent ZeroMQ libraries

Before playing with some code, you need to install ZeroMQ libraries on your system. That library is on Ubuntu 10.10, but a more recent version seems to be needed for Java bindings. That's not a problem as some good will has made a PPA repository for them:

% sudo add-apt-repository ppa:chris-lea/zeromq
% sudo aptitude install libzmq-dev

That should install libzmq-dev (header files needed for the Java bindings) and the libzmq0 package - the core messaging system itself.

Step 2: get ZeroMQ binding

For that, you will have to clone the github repository of the project

% git clone https://github.com/zeromq/jzmq.git

And with that, you have a new jzmq directory with everything needed to build the Java bindings.

Step 3: build and install jzmq package

We are on a Debian based distribution, and ZeroMQ guys have the good taste to provide all what is needed to build a .deb for JZMQ, so let's just use the good work.
In the former jzmq directory, just do:

% ./autogen.sh
% dpkg-buildpackage -rfakeroot

And that's it. If all goes well, you should have a "jzmq_[some-version]_i386.deb" package on the parent directory of the one you are in. Just install it as usual:

% dpkg -i jzmq_[some-version]_i386.deb

And now, you can use ZQM from you Java code.

Some last notes

* don't forget to add the JNI library path in you JVM command line: use -Djava.library.path=/usr/lib
(/usr/lib should contains libjzmq.so, you can see it with dpkg -L jzmq)
If you the JAVA_HOME environment variable was correctly set when you buit the package,you may not have to add that parameter. 
* libjzmq.jar is in /usr/share/java/
* you will find some Java examples here.

That's it! Enjoy a world of easy message distribution.

Monday, January 31, 2011

Martin Odersky au Paris Scala User Group le 31 janvier

 Après pas mal de temps en sommeil, je réveille ce blog pour faire suivre cette annonce: Martin Odersky, le papa de Scala, fera une présentation au Paris Scala User Group, ce lundi 31 janvier. Plus de détails sont disponibles ici et ici.

J'en profite pour relayer l'information du financement à hauteur de 2.3 Million d'Euros sur 5 ans de Scala par l'Europe, ce qui devrait permettre de lever les dernières incertitudes quant à la pérénité du langage.



Tuesday, November 9, 2010

Scala 2.8.1 is out!

After a far shorter development cycle than for 2.8.0, Scala 2.8.1 reach us today.

More than 100 bugs were corrected, some of them really old (#36 !).

The great thing with that release is that for the first time ever, it is fully binary compatible with the previous one, Scala 2.8.0. With that and the creation of Scala Solution company, it seems to be really good insights toward Scala industrialization in the coming years.

Tuesday, July 27, 2010

Set-up Eclipse workspace in RAM

I just published an article about how to set-up your Eclipse workspace in RAM to make I/O (almost) instantaneous. It was promised in the "Eclipse perfomance optimisation article", and now it's here: http://blog.normation.com/2010/07/27/set-up-eclipse-workspace-in-ram/

And like last time, any information about Eclipse optimization is much appreciated !

Sunday, July 18, 2010

Java LDAP SDK for SyncRepl replication showcase

I just published a post on my company blog about how to implement a SyncRepl client using two different Java LDAP SDK, Apache DS and UnboundID: 


http://blog.normation.com/2010/07/18/java-ldap-sdk-for-syncrepl-replication-showcase/

SyncRepl is a replication protocol for LDAP, normalized in RFC 4533.  

The demonstration is done with a showcase web application that display in real time modification done in an LDAP server. 
The application, named Syweno, was developed in Scala, thanks to Liftweb and it's amazing Comet. It looks like:



Of course, update are synchronized thank to SyncRepl, and are propagated to the web page in real time thanks to Comet updates. 

The code source is available on github here: http://github.com/fanf/syweno

Enjoy !

  © Blogger template 'Minimalist G' by Ourblogtemplates.com 2008

Back to TOP