Sunday, December 11, 2011

Trying to identify component for cloud composite application

In this post I try to figure out if I can find cloud component (free at the begining for low use, pay-per-use) usefull to build a composite application (like a mashup).
To start I define "first order" lists of required/optional components, then I try to fill it...

I publish this post in a draft state, because i'd like (dream) have comments and or cloud conponent suggestions.

Main conponents for an application


  • Identification/authentication
  • Navigation view (if graphical. Not if there is a graphical client side)
  • Communication
  • Functionnal Services
  • Stograge

Optional component

  • mail sender
  • document server
  • money registered suscriber

Provided components

  • Identification/authentication 
    • OpenId
    • Google account/apps : 
      plateform as a service but contains an authentification API allowing google account usage (good or bad idea?)

      (see http://www.google.com/apps/intl/fr/business/index.html#utm_campaign=fr&utm_source=fr-ha-emea-fr-bk&utm_medium=ha&utm_term=%2Bgoogle%20%2Bcloud)
  • Navigation view (if graphical. Not if there is a graphical client side)
    • mainly language provided (google apps for example)
    • BeaconPush : 
      Beaconpush is a push service for creating real-time web apps using HTML5 WebSockets and Comet.
  • Functionnal Services
    • Mainly language provided (google apps for example...)
  • Communication
    • http://effectivemessaging.blogspot.com/2009/02/messaging-in-cloud.html
    • Amazone SQS
    • http://cloudfoundry.com/ ; rabbit mq...
      http://blog.cloudfoundry.com/post/8713844574/rabbitmq-cloud-foundry-cloud-messaging-that-just-works
  • Stograge
    • amazone, google apps
  • mail sender 
    • Sendgrid : SendGrid replaces your email infrastructure so you don't have to build, scale, and maintain these systems in-house. 
  • document server
  • money registered suscriber
    •  Spreedly :help for register subscribers and deals with "making money"

Draft part...



References :
  • Cloud Services (from http://www.slideshare.net/gr8conf/gr8conf-2011-mybalsamiq)
compute, storage, payment, billing, web trafic










Saturday, November 26, 2011

Spring and rabbit MQ

A few days ago I post about Rabbit amqp and Spring rabbit. Basically what we have to build is an RPC like system
  • with (sometimes) intermediary message for long running services (graphics controls)
  • with data control callable on server side or client side (or both)
  • with initial configuration and so on...

As I regulary use Spring Framework I try to use it with Rabbit AMQP. I try hard but it was very difficult to make RPC like, working well without explore spring code to see how it works.... there is too few docs...).
At the end I decide to remove Spring-rabbit and keep for rabbit, IOC only without Spring abstraction. ( this work well in a couple of hours...)

It is a proof of concept, so it is not a big problem to lose this abstraction level.
In a few month I will check Spring AMQP abstraction and I'm sure this part will evolves a lot. 

Tuesday, November 15, 2011

eclipse, ubuntu and icon menu

I don't have my sweet menu in eclipse.... As I could see, I'm not alone and there's a lot of people having the same problem like me. But to solve my problem I had to apply two tips :
  • enable menu on ubuntu
gconftool-2 --type Boolean --set /desktop/gnome/interface/menus_have_icons True
see here
You could also use : gconf-editor and check desktop->gnome-interface: menus_have_icons (see here)
  • Start eclipse with a script using UBUNTU_MENUPROXY:
#!/bin/bash
export UBUNTU_MENUPROXY=0
./eclipse -vm /home/theroude/devel/exploit/Java/jdk1.6.0_13/bin 
Hope this help

Tuesday, September 13, 2011

flexjson, eclipse RCP, ClassLoader and Eclipse-BuddyPolicy

I'm developing an RCP application based on rabbitmq-JSON. To deal with JSON I'm using flexjson (I will try latter Jackson...).
This post is dedicated this encountered problem :
  • Plugin A : containing flexjson and the whole technical stack (spring-rabbit, etc....)
  • Plugin B : containing service contract  : Interfaces, response object and in other jars services implementations.
  • B have a dependency on Plugin A
  • When trying to deserialize a response object from within  B I have :

flexjson.JSONException: [  ]:  Could not load fr.frk.Service01Response

My interpretation is :
  • This is flexJson who does the Service01Response instantiation. And plugin A does not know nothing about plugin B...
  • This is a class (OSGI) loading problem.
To solve this I've found to useful  links :
So I finally does  :
  • in plugin A I've declared : 
Eclipse-BuddyPolicy: registered
  • in plugin B  I've declared : 
Eclipse-RegisterBuddy: pluginA

Thursday, July 21, 2011

Rabbit MQ - spring-amqp : waiting response (RPC like style)

I 'm testing rabbitmq and spring-ampq for a prototype. I have to use rabbitmq in an "rpc style" for some communications. I find out and do the rpc rabbit-mq tutorial (here) and finally does the same thing with spring amqp.

In this work the only point was to implement an equivalent of  
QueueingConsumer consumer = new QueueingConsumer(channel);


I replace this object by my own implementation as i don't fonnd anything in spring-rabbit abstraction.

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;


import org.springframework.amqp.core.Address;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.ChannelAwareMessageListener;


import com.rabbitmq.client.Channel;

public class ProducerMessageListener implements ChannelAwareMessageListener {
    ConnectionFactory connectionFactory;
    RemoteService callback;
   

    public BlockingQueue _queue = new LinkedBlockingQueue();
    

    public ProducerMessageListener(RemoteService callback, String corrid) {
        this.callback = callback;
    }



    public ConnectionFactory getConnectionFactory() {
        return connectionFactory;
    }

    public void setConnectionFactory(ConnectionFactory connectionFactory) {
        this.connectionFactory = connectionFactory;
    }

    

    public void onMessage(Message message, Channel channel) throws Exception {
        System.out.println("message receive on blocking process");
        try {
            Address adrs = message.getMessageProperties().getReplyTo();
            byte[] corrid = message.getMessageProperties().getCorrelationId();
            synchronized (_queue) {
                _queue.add(message);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


To use it 
ProducerMessageListener cml = new ProducerMessageListener(this, corrid);
cml.setConnectionFactory(rabbitConnectionFactory);
SimpleMessageListenerContainer asmlc = new SimpleMessageListenerContainer();
asmlc.setConnectionFactory(rabbitConnectionFactory);
asmlc.setQueueNames(replyto);
asmlc.setQueues(q);
asmlc.setMessageListener(cml);
asmlc.initialize();
asmlc.start();
       
rabbitTemplateConsumer.send(msg);
//wait on blocking queue
Message msgresponse=null;
try {
            msgresponse = cml._queue.take();
            System.out.println("got "+new String(msgresponse.getBody()));
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
       
//CARREFULL
// destroy asmlc when finish (gc..)
// destruction is time consumming so we does in thread
        new Thread(new Runnable() {
          
            @Override
            public void run() {
                    asmlc.stop();
                    asmlc.destroy();
              
            }
        }).start();
 
return new String(msgresponse.getBody());
}

Wednesday, June 29, 2011

Describing software architect job

I found a presentation about Software Architect Role.
In the whole (not always...) this presentation fit what I think about my job. Have a look if you have time.
Software (Solution) Architect role

free REST ebook

A few weeks ago i wrote many thing about REST and it's (miss)understanding.
As I navigate on software architecture I found an infoQ free book about REST. I didn't read all but what I red was enough interesting to write a small post about this.
this is the link REST emag, good reading !

Tuesday, June 7, 2011

light bug tracker

Few month ago we search a bug tracker for 10 to 15 user and internal use.
What we want :
  • simple installation (no/embedded RDBMS, running on tomcat 6.0)
  • simple tool (light to use and manage )
  • management of many workflow with many different steps
We found JTrac. This tools reply to all our needs. All The functionalities are here.
Have o look.

Wednesday, March 16, 2011

Distributed Version Control System (DVCS)

I'm currently looking for a DVCS for a new project. I found three tools :

  • mercurial
  • git
  • baazar
It's not easy to choose, and as usual I don't want to waste too much time in testing all three.

To go through the decision I found  many links :

at the end, I think, I will use mercurial and post if this tool does not fit. 

java encoding...

If you want to set java encoding to UTF-8 (or what ever you want...) you could use :

  • JAVA_TOOL_OPTIONS in you environment to set  file.encoding property with JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8  
  • starting your vm with -Dfile.encoding=UTF-8  argument
  • set the default encoding in your favorite IDE.


Wednesday, February 23, 2011

REST style

Last couple of days , I worked on a REST architecture. I never really worked on this architecture at the design level, I just applied some given rules during developments or maintenance. So I found this job very interesting.
My first surprise was to discover that a lot of people (including me) just take a  few REST characteristics  and claims to be "Restfull". In fact this is not a problem, but those people provide and promote something else that REST.
If you have time you could have a look at the Roy Thomas Fielding's phd thesis or you could have a look at the richardson maturity model. To be honest, the link that makes me realize what is really REST is this one : http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven.

The key points of REST :

  • ressources
  • hypermedia
  • server statelessness
In this list it seems thats hypermedia driven application is not well considered (accepted?). 
What ever read the previous link if what is preceding seems not clear.

Enjoy! 

Tuesday, February 8, 2011

PDE and Maven 3

During my work we have to build project documentation (as usual...). On this subjet, I like maven site. Why ? because :
  • Your documentation is at the nearest place from the source code
  • You don't have to search in which document do this task
  • you could easily put in SCM you documentation
  • you could easily create a PDF
I start working with the first version of Maven and then I have to deal with maven 2 migration and subsequent repository modification, and so on. So, I don't want to go to maven 3. Til I read how maven's community do the job. They do a lot to insure compatibilty, and it's a really big work!

So I face an old problem : my documentation is for an Eclipse Plugin and with maven 2 it was very difficult to put the build lifecycle in maven.

But I discoverer tycho for M3 and I really appreciate it. With this plugin you don't have a huge effort to do the work... You just write a small pom with tycho's dependency and args and that's all, then tycho delegate the dependencies resolution...

This plugin is version 0.8 and looks like to do a lot of thing.

Now I'm relying on this plugin for the build, metric generation and site building.