<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Hi ! My name is  Felker Robert, I live in Paris and this blog is my contribution to the community :)

  var _gaq = _gaq || [];
  _gaq.push([‘_setAccount’, ‘UA-28023775-1’]);
  _gaq.push([‘_trackPageview’]);

  (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
  })();</description><title>Sharing Sparks</title><generator>Tumblr (3.0; @aquilae)</generator><link>http://tech.robbieone.com/</link><item><title>Generate realtime charts using Vert.x websocket and highchart.js</title><description>&lt;p&gt;&lt;strong&gt;Objectif&lt;/strong&gt;: Update chart data on the client side as events occurs on the business side.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: It&amp;#8217;s the second time that &lt;a href="http://www.dzone.com/links/users/saved/964191.html" title="Promoted Links" target="_blank"&gt;DZone.com&lt;/a&gt; promote my links, thank you, it really encourage myself to write better articles.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tools&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;&lt;a href="http://vertx.io/" title="Vert.x" target="_blank"&gt;Vert.x&lt;/a&gt;, the java equivalent to node.js&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.highcharts.com/" title="Hightchart.js" target="_blank"&gt;Hightcharts.js&lt;/a&gt; a advanced javascript charting library.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/WebSocket" title="WebSocket" target="_blank"&gt;WebSocket &lt;/a&gt;is a full duplex protocol used to connect the browser to the server. ws for brevity.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Love websocket" height="324" src="http://solaar.free.fr/images/love.png" width="384"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Structure&lt;/strong&gt;: Highcharts directory contains&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;jquery-1.7.2.js&lt;/li&gt;
&lt;li&gt;highcharts.js&lt;/li&gt;
&lt;li&gt;charts.html&lt;/li&gt;
&lt;li&gt;WebSocketsServer.groovy&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Command&lt;/strong&gt;: after having installed Vert.x on at the same level of the directory use the command vertx run highcharts/WebSocketsServer.groovy then point your browser to localhost:8080.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How it works&lt;/strong&gt;: When the page is loaded the first time it establish a websocket connection with the server, the connection is not closed until you close the tab of the browser. When you click on the draw button, you&amp;#8217;re actually sending a event to the server which in counterpart is sending a json response through the ws channel. Javascript parse the location of the new point and update the chart.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Charts.html&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Web Socket Test&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;
&amp;lt;script src="jquery.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src="highcharts.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;body&amp;gt;

&amp;lt;script&amp;gt;

    var dataseries;

    var socket;
    if (window.WebSocket) {
        socket = new WebSocket("ws://localhost:8080/myapp");
        socket.onmessage = function(event) {
            //alert('data'+event.data)
            var point = JSON.parse(event.data);
            //alert('json ok'+point)
            var npoint = [parseInt(point.x),parseInt(point.y)];
            dataseries.addPoint(npoint);
        }
    } else {
        alert("Your browser does not support Websockets. (Use Chrome)");
    }

    function send(message) {
        if (!window.WebSocket) {
            return;
        }
        if (socket.readyState == WebSocket.OPEN) {
            socket.send(message);
        } else {
            alert("The socket is not open.");
        }
    }

    $(function () {
        var chart;
        $(document).ready(function() {
            chart = new Highcharts.Chart({
                chart: {
                    backgroundColor: {
                       linearGradient: [0, 0, 0, 400],
                       stops: [
                          [0, 'rgb(250, 180, 180)'],
                          [1, 'rgb(255, 240, 240)']
                       ]
                    },
                    renderTo: 'container',
                    type: 'scatter',
                    margin: [70, 50, 60, 80],
                    events: {
                        load: function(e) {
                                dataseries = this.series[0];
                        }
                    }
                },
                title: {
                    text: 'User supplied Love'
                },
                subtitle: {
                    text: 'Because we all love our Moms'
                },
                xAxis: {
                    minPadding: 0.2,
                    maxPadding: 0.2,
                    maxZoom: 60
                },
                yAxis: {
                    title: {
                        text: 'Value'
                    },
                    minPadding: 0.2,
                    maxPadding: 0.2,
                    maxZoom: 60,
                    plotLines: [{
                        value: 0,
                        width: 1,
                        color: '#FF0000'
                    }]
                },
                legend: {
                    enabled: false
                },
                exporting: {
                    enabled: false
                },
                plotOptions: {
                  line: {
                       dataLabels: {
                          color: '#CCC'
                       },
                       marker: {
                          lineColor: '#333'
                       }
                    },
                    series: {
                        lineWidth: 2,
                        color: '#FF0000',
                        point: {
                            events: {
                                'click': function() {
                                    if (this.series.data.length &amp;gt; 1) this.remove();
                                }
                            }
                        }
                    }
                },
                series: [{
                    data: [[0, 0]]
                }]
            });
        });
        
    });
&amp;lt;/script&amp;gt;

&amp;lt;form onsubmit="return false;"&amp;gt;
    &amp;lt;input type="hidden" name="message" value='draw'/&amp;gt;
    &amp;lt;input type="button" value="Draw" onclick="send(this.form.message.value)"/&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;script src="jquery.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script src="highcharts.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;&lt;![CDATA[// &lt;![CDATA[
// &lt;![CDATA[
// &lt;![CDATA[
    var dataseries;

    var socket;
    if (window.WebSocket) {
        socket = new WebSocket("ws://localhost:8080/myapp");
        socket.onmessage = function(event) {
            //alert('data'+event.data)
            var point = JSON.parse(event.data);
            //alert('json ok'+point)
            var npoint = [parseInt(point.x),parseInt(point.y)];
            dataseries.addPoint(npoint);
        }
    } else {
        alert("Your browser does not support Websockets. (Use Chrome)");
    }

    function send(message) {
        if (!window.WebSocket) {
            return;
        }
        if (socket.readyState == WebSocket.OPEN) {
            socket.send(message);
        } else {
            alert("The socket is not open.");
        }
    }

    $(function () {
        var chart;
        $(document).ready(function() {
            chart = new Highcharts.Chart({
                chart: {
                    backgroundColor: {
                       linearGradient: [0, 0, 0, 400],
                       stops: [
                          [0, 'rgb(250, 180, 180)'],
                          [1, 'rgb(255, 240, 240)']
                       ]
                    },
                    renderTo: 'container',
                    type: 'scatter',
                    margin: [70, 50, 60, 80],
                    events: {
                        load: function(e) {
                                dataseries = this.series[0];
                        }
                    }
                },
                title: {
                    text: 'User supplied Love'
                },
                subtitle: {
                    text: 'Because we all love our Moms'
                },
                xAxis: {
                    minPadding: 0.2,
                    maxPadding: 0.2,
                    maxZoom: 60
                },
                yAxis: {
                    title: {
                        text: 'Value'
                    },
                    minPadding: 0.2,
                    maxPadding: 0.2,
                    maxZoom: 60,
                    plotLines: [{
                        value: 0,
                        width: 1,
                        color: '#FF0000'
                    }]
                },
                legend: {
                    enabled: false
                },
                exporting: {
                    enabled: false
                },
                plotOptions: {
                  line: {
                       dataLabels: {
                          color: '#CCC'
                       },
                       marker: {
                          lineColor: '#333'
                       }
                    },
                    series: {
                        lineWidth: 2,
                        color: '#FF0000',
                        point: {
                            events: {
                                'click': function() {
                                    if (this.series.data.length &gt; 1) this.remove();
                                }
                            }
                        }
                    }
                },
                series: [{
                    data: [[0, 0]]
                }]
            });
        });
        
    });
// ]]]]]]]]&gt;&lt;![CDATA[&gt;&lt;![CDATA[&gt;&lt;![CDATA[&gt;
// ]]]]]]&gt;&lt;![CDATA[&gt;&lt;![CDATA[&gt;
// ]]]]&gt;&lt;![CDATA[&gt;]]&gt;&lt;/script&gt;&lt;/pre&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;WebSocketServer.groovy&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;package websockets

def halfpart = []
halfpart.add([-2,25])
halfpart.add([-3,35])
halfpart.add([-4,45])
halfpart.add([-6,55])
halfpart.add([-7,65])
halfpart.add([-7,80])
halfpart.add([-6,90])
halfpart.add([-5,97])
halfpart.add([-4,100])
halfpart.add([-3,97])
halfpart.add([-2,90])
halfpart.add([-1,82])
halfpart.add([-0,75])

def drawing = []

halfpart.each{ drawing &amp;lt;&amp;lt; it }
drawing.pop()

halfpart.reverse().each{ drawing &amp;lt;&amp;lt; [-it[0],it[1]] }
drawing &amp;lt;&amp;lt; [0,0]

println(drawing)

def counter = 0

vertx.createHttpServer().websocketHandler { ws -&amp;gt;
  ws.dataHandler { data -&amp;gt;
  		def location = drawing[counter%drawing.size()]
  		def template = """{"x":"${location[0]}","y":"${location[1]}"}""" 
  		ws.writeTextFrame(template)
  		counter++
}
}.requestHandler { req -&amp;gt;
  if (req.uri == "/") req.response.sendFile "highcharts/charts.html"
  if (req.uri == '/jquery.js') req.response.sendFile('highcharts/jquery-1.7.2.js')
  if (req.uri == '/highcharts.js') req.response.sendFile('highcharts/highcharts.js')
}.listen(8080)


&lt;/pre&gt;
&lt;/blockquote&gt;</description><link>http://tech.robbieone.com/post/23111394759</link><guid>http://tech.robbieone.com/post/23111394759</guid><pubDate>Tue, 15 May 2012 19:53:00 +0200</pubDate><category>vertx</category><category>chart</category><category>websocket</category><category>javascript</category></item><item><title>Stomp, Bootstrap and ActiveMQ meet for realtime HTML5 directed by Camel</title><description>&lt;p&gt;About the &lt;strong&gt;actors&lt;/strong&gt; of this &lt;strong&gt;story&lt;/strong&gt;&amp;#160;:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Apache ActiveMQ 5.6.0 and the new stomp connector, &amp;#8220;the master&amp;#8221;&lt;/li&gt;
&lt;li&gt;Apache Camel :  &lt;span&gt;&amp;#8220;the great conductor&amp;#8221;&amp;#160;!&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Stomp.js, connecting directly javascript to ActiveMQ, &amp;#8220;the shadow worker&amp;#8221;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Twitter Bootstrap.js, &amp;#8220;the beautifull babe&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;span&gt;&lt;br/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;update : &lt;/strong&gt;after some magic HTML5 canvas function, you get this asynchronous, loosely tied, event-based rendering.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;img alt="Quotes Cancas" height="173" src="http://solaar.free.fr/images/quotes_canvas.png" width="500"/&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;br/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Steps to complete&amp;#160;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;br/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;ol&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;Look &lt;/span&gt;&lt;a href="http://activemq.apache.org/stomp.html" title="Stomp on ActiveMQ" target="_blank"&gt;how to active the stomp component here&lt;/a&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Start ActiveMQ in the &lt;strong&gt;bin&lt;/strong&gt; directory, you can test your installation by pointing to  &lt;a href="http://localhost:8161/" target="_blank"&gt;http://localhost:8161/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Create the Html template, for brevity I use a static one but you can deploy it into your container ( Apache, Node.js, Vertx, Buzz word here )&lt;/li&gt;
&lt;li&gt;Setup the Javascript that combine the listening of Stomp event and BootStrap&lt;/li&gt;
&lt;li&gt;Faking stocks values using Camel, you can check my previous blog post on &lt;a href="http://tech.robbieone.com/post/15341612892/combine-yahoo-finance-and-hbase-using-camel-and-rest" title="Getting yahoo quotes" target="_blank"&gt;how to get real ones&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;1.html template&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;The template is empty and do nothing except the layout and loading the js and css ressources.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;blockquote&gt;
&lt;div&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;#8221; &amp;#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;#8221;&amp;gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;#8220;-//W3C//DTD HTML 4.01 Transitional//EN&amp;#8221; &amp;#8220;http://www.w3.org/TR/html4/loose.dtd&amp;#8221;&amp;gt;&lt;/div&gt;
&lt;div&gt;&amp;lt;html&amp;gt;&lt;/div&gt;
&lt;div&gt;&amp;lt;head&amp;gt;&lt;/div&gt;
&lt;div&gt;    &amp;lt;meta http-equiv=&amp;#8221;Content-Type&amp;#8221; content=&amp;#8221;text/html; charset=iso-8859-1&amp;#8221; /&amp;gt;&lt;/div&gt;
&lt;div&gt;    &amp;lt;title&amp;gt;Chat Example Using Stomp Over WebSocket&amp;lt;/title&amp;gt;&lt;/div&gt;
&lt;div&gt;    &amp;lt;link rel=&amp;#8221;stylesheet&amp;#8221; type=&amp;#8221;text/css&amp;#8221; href=&amp;#8221;css/docs.css&amp;#8221;&amp;gt;&amp;lt;/link&amp;gt;&lt;/div&gt;
&lt;div&gt;    &amp;lt;link rel=&amp;#8221;stylesheet&amp;#8221; type=&amp;#8221;text/css&amp;#8221; href=&amp;#8221;css/bootstrap.css&amp;#8221;&amp;gt;&amp;lt;/link&amp;gt;&lt;/div&gt;
&lt;div&gt;    &amp;lt;link rel=&amp;#8221;stylesheet&amp;#8221; type=&amp;#8221;text/css&amp;#8221; href=&amp;#8221;css/bootstrap-responsive.css&amp;#8221;&amp;gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;    &amp;lt;script type=&amp;#8221;text/javascript&amp;#8221; src=&amp;#8221;js/jquery-1.7.2.js&amp;#8221;&amp;gt;&amp;lt;/script&amp;gt;&lt;/div&gt;
&lt;div&gt;    &amp;lt;script type=&amp;#8221;text/javascript&amp;#8221; src=&amp;#8217;js/stomp.js&amp;#8217;&amp;gt;&amp;lt;/script&amp;gt;&lt;/div&gt;
&lt;div&gt;    &amp;lt;script type=&amp;#8221;text/javascript&amp;#8221; src=&amp;#8217;js/quotes.js&amp;#8217;&amp;gt;&amp;lt;/script&amp;gt;&lt;/div&gt;
&lt;div&gt;    &amp;lt;script type=&amp;#8221;text/javascript&amp;#8221; src=&amp;#8217;js/bootstrap.js&amp;#8217;&amp;gt;&amp;lt;/script&amp;gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;    &amp;lt;script&amp;gt;&lt;/div&gt;
&lt;div&gt;        $(document).ready(function() {&lt;/div&gt;
&lt;div&gt;        var supported = (&amp;#8220;WebSocket&amp;#8221; in window);&lt;/div&gt;
&lt;div&gt;        if(!supported) {&lt;/div&gt;
&lt;div&gt;        var msg = &amp;#8220;Your browser does not support Web Sockets. This example will not work properly.&amp;lt;br&amp;gt;&amp;#8221;;&lt;/div&gt;
&lt;div&gt;        msg += &amp;#8220;Please use a Web Browser with Web Sockets support (WebKit or Google Chrome).&amp;#8221;;&lt;/div&gt;
&lt;div&gt;        $(&amp;#8220;#connect&amp;#8221;).html(msg);&lt;/div&gt;
&lt;div&gt;        }&lt;/div&gt;
&lt;div&gt;        });&lt;/div&gt;
&lt;div&gt;    &amp;lt;/script&amp;gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;
&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;lt;div class=&amp;#8221;container-fluid&amp;#8221;&amp;gt;&lt;/div&gt;
&lt;div&gt;  &amp;lt;div class=&amp;#8221;row show-grid&amp;#8221; id=&amp;#8221;quotes&amp;#8221;&amp;gt;&lt;/div&gt;
&lt;div&gt;      &amp;lt;!&amp;#8212; Quotes templates will append here&amp;#8212;&amp;gt;&lt;/div&gt;
&lt;div&gt;  &amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt; &amp;lt;div id=&amp;#8221;disconnect&amp;#8221;&amp;gt;&lt;/div&gt;
&lt;div&gt;    &amp;lt;form id=&amp;#8217;disconnect_form&amp;#8217;&amp;gt;&lt;/div&gt;
&lt;div&gt;        &amp;lt;input type=submit id=&amp;#8217;disconnect_submit&amp;#8217; value=&amp;#8221;Disconnect&amp;#8221;&amp;gt;&lt;/div&gt;
&lt;div&gt;    &amp;lt;/form&amp;gt;&lt;/div&gt;
&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;
&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;2 Quotes.js&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;On event, check the json object that is received and look at the quote attribute then if this attribute exist as and id in the html update his children fields or create it. &lt;/div&gt;
&lt;blockquote&gt;
&lt;div&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;$(document).ready(function(){&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;  var client, destination;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;  var url = &amp;#8216;ws://localhost:61614/stomp&amp;#8217;;&lt;/div&gt;
&lt;div&gt;  var login = &amp;#8216;guest&amp;#8217;;&lt;/div&gt;
&lt;div&gt;  var passcode = &amp;#8216;guest&amp;#8217;;&lt;/div&gt;
&lt;div&gt;  destination = &amp;#8216;/topic/messages&amp;#8217;;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;  client = Stomp.client(url);&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;  // this allows to display debug logs directly on the web page&lt;/div&gt;
&lt;div&gt;  client.debug = function(str) {&lt;/div&gt;
&lt;div&gt;    $(&amp;#8220;#debug&amp;#8221;).append(str + &amp;#8220;\n&amp;#8221;);&lt;/div&gt;
&lt;div&gt;  };&lt;/div&gt;
&lt;div&gt;  // the client is notified when it is connected to the server.&lt;/div&gt;
&lt;div&gt;  var onconnect = function(frame) {&lt;/div&gt;
&lt;div&gt;    client.debug(&amp;#8220;connected to Stomp&amp;#8221;);&lt;/div&gt;
&lt;div&gt;    $(&amp;#8216;#disconnect&amp;#8217;).fadeIn();&lt;/div&gt;
&lt;div&gt;    $(&amp;#8216;#send_form_input&amp;#8217;).removeAttr(&amp;#8216;disabled&amp;#8217;);&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;    client.subscribe(destination, function(message) {&lt;/div&gt;
&lt;div&gt;      var j = jQuery.parseJSON(message.body);&lt;/div&gt;
&lt;div&gt;      if(!$(&amp;#8216;#&amp;#8217;+j.quote).length) {&lt;/div&gt;
&lt;div&gt;        alert(&amp;#8220;not founded&amp;#8221;);&lt;/div&gt;
&lt;div&gt;        $(&amp;#8216;#quotes&amp;#8217;).append(&amp;#8216;&amp;lt;div id=&amp;#8221;&amp;#8217;+j.quote+&amp;#8217;&amp;#8221; class=&amp;#8221;span2&amp;#8221;&amp;gt;&amp;lt;h5&amp;gt;&amp;#8217;+j.quote+&amp;#8217;&amp;lt;/h5&amp;gt;&amp;lt;div class=&amp;#8221;quote_open&amp;#8221;&amp;gt;-&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;#8221;quote_hi&amp;#8221;&amp;gt;-&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;#8221;quote_low&amp;#8221;&amp;gt;-&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;#8221;quote_close&amp;#8221;&amp;gt;-&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;#8217;);&lt;/div&gt;
&lt;div&gt;      }&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;      $(&amp;#8216;#&amp;#8217;+j.quote).find(&amp;#8216;.quote_open&amp;#8217;).html(j.open)&lt;/div&gt;
&lt;div&gt;      $(&amp;#8216;#&amp;#8217;+j.quote).find(&amp;#8216;.quote_hi&amp;#8217;).html(j.hi)&lt;/div&gt;
&lt;div&gt;      $(&amp;#8216;#&amp;#8217;+j.quote).find(&amp;#8216;.quote_low&amp;#8217;).html(j.low)&lt;/div&gt;
&lt;div&gt;      $(&amp;#8216;#&amp;#8217;+j.quote).find(&amp;#8216;.quote_close&amp;#8217;).html(j.close)&lt;/div&gt;
&lt;div&gt;    });&lt;/div&gt;
&lt;div&gt;  };&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;  client.connect(login, passcode, onconnect);&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;  $(&amp;#8216;#disconnect_form&amp;#8217;).submit(function() {&lt;/div&gt;
&lt;div&gt;    client.disconnect(function() {&lt;/div&gt;
&lt;div&gt;      $(&amp;#8216;#disconnect&amp;#8217;).fadeOut({ duration: &amp;#8216;fast&amp;#8217; });&lt;/div&gt;
&lt;div&gt;    });&lt;/div&gt;
&lt;div&gt;    return false;&lt;/div&gt;
&lt;div&gt;  });&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;});&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;3. Camel Code&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;Generate fake values and send them to the queue. You can write this part in any languages you want, ruby, javascript,.net. That&amp;#8217;s why it&amp;#8217;s called an integration tool. Adding a value to this topic (and not queue) share it with all the stomp.js instances that are listening. Now you only have to replace this part with your true data stream.&lt;/div&gt;
&lt;blockquote&gt;
&lt;div&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;import java.util.Random;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;import org.apache.camel.CamelContext;&lt;/div&gt;
&lt;div&gt;import org.apache.camel.Exchange;&lt;/div&gt;
&lt;div&gt;import org.apache.camel.Processor;&lt;/div&gt;
&lt;div&gt;import org.apache.camel.builder.RouteBuilder;&lt;/div&gt;
&lt;div&gt;import org.apache.camel.impl.DefaultCamelContext;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;public class YahooFeed {&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;/**&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt; * @param args&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt; */&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;public static void main(String[] args) {&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;CamelContext ctx = new DefaultCamelContext();&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;try {&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;ctx.addRoutes(new RouteBuilder() {&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;@Override&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;public void configure() throws Exception {&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;from(&amp;#8220;quartz://sources/fake?cron=0/5+*+*+*+*+?&amp;#8221;).process(new YahooFeed.FakeProcessor()).to(&amp;#8220;activemq:topic:messages&amp;#8221;);&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;});&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;ctx.start();&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;} catch (Exception e) {&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;e.printStackTrace();&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;static class FakeProcessor implements Processor {&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;private final Random rdm = new Random();&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;private final String[] stocks = new String[] { &amp;#8220;OCZ&amp;#8221;, &amp;#8220;RHT&amp;#8221;, &amp;#8220;FIO&amp;#8221;,&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&amp;#8220;AMZN&amp;#8221;, &amp;#8220;XIO&amp;#8221; };&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;@Override&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;public void process(Exchange ex) throws Exception {&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;String share = stocks[rdm.nextInt(stocks.length)];&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;int low = rdm.nextInt(100) + 10;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;int hi = low * 3;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;int open = low * 2;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;int close = open + rdm.nextInt(20);&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;String rs = &amp;#8220;{&amp;#34;quote&amp;#34;:&amp;#34;&amp;#8221; + share + &amp;#8220;&amp;#34;,&amp;#34;open&amp;#34;:&amp;#34;&amp;#8221; + open&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;+ &amp;#8220;&amp;#34;,&amp;#34;hi&amp;#34;:&amp;#34;&amp;#8221; + hi + &amp;#8220;&amp;#34;,&amp;#34;low&amp;#34;:&amp;#34;&amp;#8221; + low + &amp;#8220;&amp;#34;,&amp;#34;close&amp;#34;:&amp;#34;&amp;#8221;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;+ close + &amp;#8220;&amp;#34;}&amp;#8221;;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;System.out.println(&amp;#8220;generated &amp;#8220;+rs);&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;ex.getIn().setBody(rs);&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;}&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;And that&amp;#8217;s it. Meteor.js, Node.js, Vert.X, Play2 are all new tools promoting new coding style. It doesn&amp;#8217;t matter your choice! Each language/framework teams provide the right tools that implements the right concept. Choose the one you are confortable with and share the knowledge.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Disclosure: &amp;#8216;am Long OCZ ;)&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;</description><link>http://tech.robbieone.com/post/22988864229</link><guid>http://tech.robbieone.com/post/22988864229</guid><pubDate>Sun, 13 May 2012 21:45:00 +0200</pubDate><category>camel</category><category>activemq</category><category>stomp</category><category>bootstrap.js</category></item><item><title>Putting Jasig-Cas on Cloud [Cloudbees]</title><description>&lt;p&gt;&lt;a href="http://www.jasig.org/cas" title="Jasig CAS" target="_blank"&gt;Jasig Cas&lt;/a&gt; stand for Central Authentication Service. It&amp;#8217;s a webapp that allows &lt;a href="http://en.wikipedia.org/wiki/Single_sign-on" title="Single Sign On" target="_self"&gt;Single Sign On/Out&lt;/a&gt; for all your applications. It can be coupled to ldap, jdbc, X.509, etc. You can find more on authentification modules &lt;a href="https://wiki.jasig.org/display/CASUM/Authentication" title="CAS Authentification" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;What&amp;#8217;s the meaning&amp;#160;? in fact in the cloud you will deploy a lot of applications each one representing a service for your compagny. Should the user identify itself when he use the CRM and then login again when using the ERP&amp;#160;? CAS is the solution.&lt;/p&gt;
&lt;p&gt;CAS provide a single login window which is displayed when you tried to access a service for the first time. It memorize the Url of the service you want to access, check your credentials, generate a ticket and send it back to the service. The next service ask Cas for a ticket when you tried to reach it and if found you are granted or send back to the login.&lt;/p&gt;
&lt;p&gt;In this tutorial i&amp;#8217;ll show you how to setup a basic Cas server on Cloudbees and how to fill credential in a simple file. You&amp;#8217;ll be able to configure it on your own using this base.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Preparations&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Download the Cas server implementation &lt;a href="http://www.jasig.org/cas" title="Cas Server" target="_blank"&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Install &lt;a href="http://maven.apache.org/" title="Maven" target="_blank"&gt;Maven &lt;/a&gt;if not already installed.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;Getting Started&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Unzip the Cas server distribution&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;&lt;strong&gt;Prepare the file identification module&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;Cas is very modulable, you can load only the part that is required to your project. The generic module can load identification from a XML declaration.&lt;/div&gt;
&lt;ol&gt;&lt;li&gt;Enter the directory cas-server-3.4.XX\cas-server-support-generic&lt;/li&gt;
&lt;li&gt;Type&amp;#160;: &lt;em&gt;mvn install &lt;/em&gt;to start the building of the module&lt;/li&gt;
&lt;li&gt;Get the cas-server-support-generic-XXX.jar in the target directory just created &lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;Prepare the web application&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The webapps contains the core of the Cas server, it load authentification modules, display the login page which you can brand to your compagny and allow you to configure the services that can be CASified.&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Enter the directory cas-server-3.4.XX\cas-server-webapp&lt;/li&gt;
&lt;li&gt;Type : &lt;em&gt;mvn install &lt;/em&gt;to start the building of the web archive&lt;/li&gt;
&lt;li&gt;War are just zip file, extract the archive, i use 7zip&lt;/li&gt;
&lt;li&gt;In the Web-Inf/lib, paste the  cas-server-support-generic-XXX.jar&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;Configure the authentification&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Define the admin&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Open the file &lt;strong&gt;deployerConfigContext.xml &lt;/strong&gt;and found the section&lt;/p&gt;
&lt;p&gt;&amp;lt;sec:user-service id=&amp;#8221;userDetailsService&amp;#8221;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;sec:user name=&amp;#8221;@@THIS SHOULD BE REPLACED@@&amp;#8221; password=&amp;#8221;notused&amp;#8221; authorities=&amp;#8221;ROLE_ADMIN&amp;#8221; /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/sec:user-service&amp;gt;&lt;/p&gt;
&lt;p&gt;Replace @@THIS SHOULD BE REPLACED@@ with a new user&amp;#160;: &lt;strong&gt;itsme&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;this user now have the role of Admin, once identified it can control the cas server.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Configure the authentification handler&amp;#160;: source of credentials&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the same file replace the section&lt;/p&gt;
&lt;p&gt;&amp;lt;bean class=&amp;#8221;org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler&amp;#8221; /&amp;gt;&lt;/p&gt;
&lt;p&gt;with this one&lt;/p&gt;
&lt;p&gt;&amp;lt;bean class=&amp;#8221;org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler&amp;#8221;&amp;gt;&lt;/p&gt;
&lt;p&gt;            &amp;lt;property name=&amp;#8221;users&amp;#8221;&amp;gt;&lt;/p&gt;
&lt;p&gt;               &amp;lt;map&amp;gt;&lt;/p&gt;
&lt;p&gt;                  &amp;lt;entry key=&amp;#8221;&lt;strong&gt;itsme&lt;/strong&gt;&amp;#8221; value=&amp;#8221;cantremember&amp;#8221; /&amp;gt;&lt;/p&gt;
&lt;p&gt;                  &amp;lt;entry key=&amp;#8221;rick&amp;#8221; value=&amp;#8221;roll&amp;#8221; /&amp;gt;&lt;/p&gt;
&lt;p&gt;               &amp;lt;/map&amp;gt;&lt;/p&gt;
&lt;p&gt;            &amp;lt;/property&amp;gt;&lt;/p&gt;
&lt;p&gt;        &amp;lt;/bean&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Create the CloudBees environnement&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Create a free account and quickly check &lt;a href="http://wiki.cloudbees.com/bin/view/RUN/GettingStarted" target="_blank"&gt;&lt;a href="http://wiki.cloudbees.com/bin/view/RUN/GettingStarted" target="_blank"&gt;http://wiki.cloudbees.com/bin/view/RUN/GettingStarted&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Configure the &lt;/strong&gt;&lt;strong&gt;environnement&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Open the file WEB-INF/cas.properties&lt;/li&gt;
&lt;li&gt;Configure server.prefix= &lt;a href="http://cas.ubi.cloudbees.net/" target="_blank"&gt;&lt;a href="http://cas.your_account.cloudbees.net" target="_blank"&gt;http://cas.your_account.cloudbees.net&lt;/a&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;War&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now archive all the directory as a zip file and change the extension from .zip to .war. Take care to respect the deployment tree&amp;#160;! the zip contains WEB-INF not another sub directory&amp;#160;!!!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;UPLOAD&amp;#160;!!!&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Fast way&amp;#160;: upload your file to cloudbees using the application manager&lt;/li&gt;
&lt;li&gt;Production&amp;#160;: open a dev@cloudbees.com and use git with ssh&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;And that&amp;#8217;s it&amp;#160;! the server is ready. You can now point your browser to your application : &lt;a href="http://cas.ubi.cloudbees.net/" target="_blank"&gt;http://cas. &lt;/a&gt;&lt;a href="http://cas.ubi.cloudbees.net/" target="_blank"&gt;your_account&lt;/a&gt;&lt;a href="http://cas.ubi.cloudbees.net/" target="_blank"&gt; .cloudbees.net&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Configure the Cas services &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Point your browser to &lt;a href="http://cas.ubi.cloudbees.net/" target="_blank"&gt;http://cas. &lt;/a&gt;&lt;a href="http://cas.ubi.cloudbees.net/" target="_blank"&gt;your_account&lt;/a&gt;&lt;a href="http://cas.ubi.cloudbees.net/" target="_blank"&gt; .cloudbees.net&lt;/a&gt;/services and login using itsme/cantremember. Now you have access to the services control panel where you can configure all your CASified applications.&lt;/p&gt;
&lt;p&gt;If you are starting with cas you can find CASified applications here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://wiki.jasig.org/display/CASUM/End-to-end+Windows+Example#End-to-endWindowsExample-DeploytheProtectedApplications" target="_blank"&gt;&lt;a href="https://wiki.jasig.org/display/CASUM/End-to-end+Windows+Example#End-to-endWindowsExample-DeploytheProtectedApplications" target="_blank"&gt;https://wiki.jasig.org/display/CASUM/End-to-end+Windows+Example#End-to-endWindowsExample-DeploytheProtectedApplications&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What&amp;#8217;s really great for me is that this app is on the cloud, there&amp;#8217;s is few possibilities of getting down and it extract the complexity of authenfication from my services.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Don&amp;#8217;t know why, i got a lot of errors with local and file not found when trying to deploy on Jelastic which is also a great platform. If someone can provide indications, it&amp;#8217;s more than welcome.&lt;/p&gt;</description><link>http://tech.robbieone.com/post/16927914948</link><guid>http://tech.robbieone.com/post/16927914948</guid><pubDate>Thu, 02 Feb 2012 19:31:00 +0100</pubDate><category>Jelastic</category><category>Jasig Cas</category><category>Cloud</category></item><item><title>Integration of Trading Technologies XTrader with ActiveMQ</title><description>&lt;p&gt;Trading Technologies XTrader is one of the leading platform in finance. It offers a lot of services, orders on Fx, Future, Options, etc. XTApi is the .ddl Api that connect directly to Gardian, the sublayer of XTrader and can be used to interface with your SI.&lt;/p&gt;
&lt;p&gt;Microsoft languages are a long time legacy in this domain but your SI may be written using others techologies (Java, Scala, etc). There&amp;#8217;s several ways to do the mix, you may choose databases, tools like Protobuffer or Thrift but for this one you better choose ApacheMQ for it&amp;#8217;s combo with Camel.&lt;/p&gt;
&lt;p&gt;Apache NMS is a sub project which allow you to send messages using C# but the main advantage is that with queues you can now setup advanced treatment pattern like pubsub or parallel distribution of the informations. When this is implemented all the project can be driven using Apache Camel rules.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a default implementation to help you start&amp;#160;:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Solido/TTCamel" target="_blank"&gt;&lt;a href="https://github.com/Solido/TTCamel" target="_blank"&gt;https://github.com/Solido/TTCamel&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://tech.robbieone.com/post/16919990337</link><guid>http://tech.robbieone.com/post/16919990337</guid><pubDate>Thu, 02 Feb 2012 15:29:00 +0100</pubDate><category>ActiveMQ</category><category>Apache NMS</category><category>apache Camel</category></item><item><title>My free Zen Widget on Android</title><description>&lt;p&gt;I&amp;#8217;ve setup a zen sound widget on Android, get it for free &lt;a href="https://market.android.com/details?id=com.robbieone.plum&amp;amp;feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5yb2JiaWVvbmUucGx1bSJd" title="Plum Widget" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;


&lt;div&gt;
&lt;div class="GGJ3GERDNCB"&gt;
&lt;div&gt;&lt;span class="GGJ3GERDON" title="Note : 5 étoiles (Très satisfaisante)"&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;/span&gt; Azra le 6 octobre 2011 &lt;/div&gt;
&lt;p class="GGJ3GERDOCB"&gt;Perfect!	I love this bell! Sounds just like an actual bell I own.&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class="GGJ3GERDNCB"&gt;
&lt;div&gt;&lt;span class="GGJ3GERDON" title="Note : 5 étoiles (Très satisfaisante)"&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;/span&gt; EVE le 14 mai 2011 &lt;/div&gt;
&lt;p class="GGJ3GERDOCB"&gt;Simple &amp;amp; calming widget, thanks.&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class="GGJ3GERDNCB"&gt;
&lt;div&gt;&lt;span class="GGJ3GERDON" title="Note : 5 étoiles (Très satisfaisante)"&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;/span&gt; julien le 9 mars 2011&lt;/div&gt;
&lt;p class="GGJ3GERDOCB"&gt;Great app, very relaxing.&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class="GGJ3GERDNCB"&gt;
&lt;div&gt;&lt;span class="GGJ3GERDON" title="Note : 5 étoiles (Très satisfaisante)"&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;/span&gt; Paul le 9 mars 2011&lt;/div&gt;
&lt;p class="GGJ3GERDOCB"&gt;Tip top la cloche!&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div class="GGJ3GERDNCB"&gt;
&lt;div&gt;&lt;span class="GGJ3GERDON" title="Note : 5 étoiles (Très satisfaisante)"&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;span class="GGJ3GERDBO"&gt; &lt;/span&gt;&lt;/span&gt; joseph le 17 janvier 2011 &lt;/div&gt;
&lt;p class="GGJ3GERDOCB"&gt;Amazing sounding bell. Very long sustain.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;</description><link>http://tech.robbieone.com/post/15837855995</link><guid>http://tech.robbieone.com/post/15837855995</guid><pubDate>Sat, 14 Jan 2012 19:51:00 +0100</pubDate></item><item><title>Combine Yahoo Finance and HBase using Camel and Rest</title><description>&lt;p&gt;&lt;strong&gt;Update &lt;/strong&gt;: this article was published on the &lt;a href="http://camel.apache.org/articles.html" title="Robert Felker published on official Camel Articles" target="_blank"&gt;Articles on Camel&lt;/a&gt; section in the official Camel wiki. Thank you &lt;a href="http://www.manning.com/ibsen/" title="Ibsen publication at Manning" target="_blank"&gt;Claus&lt;/a&gt;&amp;#160;!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&amp;#160;: promoted on DZone : &lt;a href="http://www.dzone.com/links/users/saved/964191.html" target="_blank"&gt;&lt;a href="http://www.dzone.com/links/users/saved/964191.html" target="_blank"&gt;http://www.dzone.com/links/users/saved/964191.html&lt;/a&gt;&lt;/a&gt;&amp;#160;!&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s our program&amp;#160;:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;&lt;strong&gt;How to get the quotes from Yahoo&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Start HBase and Stargate (HBase using Rest)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Define HBase schema&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Accessing Stargate&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;strong&gt;Camel&lt;/strong&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;1: How to get the quotes from Yahoo&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;First we need to configure the yahoo url that return the quotes, there are many ways to get them. One is the configurable URL, see &lt;strong&gt;&lt;a href="http://www.gummy-stuff.org/Yahoo-data.htm" title="gummy yahoo finance" target="_blank"&gt;here&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Since i&amp;#8217;m gonna works on OCZ and AMZN my url will look something like this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://download.finance.yahoo.com/d/quotes.csv?f=snl1d1t1ohgdr&amp;amp;s=%22+url_quotes+%22&amp;amp;throwExceptionOnFailure=false" title="Yahoo finance" target="_blank"&gt;&lt;em&gt;&lt;a href="http://download.finance.yahoo.com/d/quotes.csv?f=sl1d1t1ohgdr&amp;amp;s=OCZ+AMZN&amp;amp;throwExceptionOnFailure=false" target="_blank"&gt;http://download.finance.yahoo.com/d/quotes.csv?f=sl1d1t1ohgdr&amp;amp;s=OCZ+AMZN&amp;amp;throwExceptionOnFailure=false&lt;/a&gt;&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you put this URL in your browser a file quotes.csv will start to download and it shoud contains that&amp;#160;:&lt;/p&gt;
&lt;p&gt;&amp;#8220;OCZ&amp;#8221;,&amp;#8221;OCZ Technology Gr&amp;#8221;,6.85,&amp;#8221;1/3/2012&amp;#8221;,&amp;#8221;4:00pm&amp;#8221;,6.77,7.00,6.72,0.00,N/A&lt;/p&gt;
&lt;p&gt;&amp;#8220;AMZN&amp;#8221;,&amp;#8221;Amazon.com,Inc.&amp;#8221;,179.03,&amp;#8221;1/3/2012&amp;#8221;,&amp;#8221;4:00pm&amp;#8221;,176.10,179.475,175.55,0.00,91.25&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2: Start HBase and Stargate (HBase using Rest)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;First you need a linux distribution, Hbase on windows is like hell ;)&lt;/p&gt;
&lt;p&gt;Next it&amp;#8217;s still hello because HBase will not be compatible with the last Mint 12 or Ubuntu. My setup use Ubuntu 10 LTS.&lt;/p&gt;
&lt;p&gt;You can find how to install and start HBase in their &lt;a href="http://hbase.apache.org/book.html#getting_started" title="HBase getting started" target="_blank"&gt;getting started with HBase&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Start HBase:  &lt;span&gt;% ./bin/start-hbase.sh&lt;/span&gt; &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The HBase Wiki team has wrote a complete article on how to start and test Stargate the bundle that brigde HBase and Rest. You can find how to setup it and test it using the curl command &lt;strong&gt;&lt;a href="http://wiki.apache.org/hadoop/Hbase/Stargate" title="Stargate" target="_blank"&gt;here&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Start Stargate : &lt;span&gt;% ./bin/hbase rest start -p 8484&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3: &lt;/strong&gt;&lt;strong&gt;Define HBase schema&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After starting the server you can access the shell using this command&amp;#160;:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span&gt;% &lt;/span&gt;&lt;span&gt;./bin/hbase shell&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;Designing schema in NoSql is a complete study and I cannot treat it here so i&amp;#8217;m only suggesting this schema as a starter.&lt;/p&gt;
&lt;p&gt;Create the table quotes and the first column family&amp;#160;:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;hbase(main):001:0&amp;gt; create &amp;#8216;quotes&amp;#8217;, &amp;#8216;time&amp;#8217;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And you can test a manual insert using this&amp;#160;:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;hbase(main):002:0&amp;gt; put &amp;#8216;quotes&amp;#8217;, &amp;#8216;OCZ&amp;#8217;, &amp;#8216;time:20120103&amp;#8217;, 6.80&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And query all the quotes using&amp;#160;:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;hbase(main):003:0&amp;gt; scan &amp;#8216;quotes&amp;#8217;,&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;All this means that you can now query HBase using Http but also insert values using the POST method has we will see later.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;strong&gt;4: Accessing Stargate&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now you can open you browser and check what&amp;#8217;s going on&amp;#160;! &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;pointing it to &lt;em&gt;http://[hbase-server-host]:8484 &lt;/em&gt;&lt;/span&gt;&lt;span&gt;will list you all available table&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;and &lt;/span&gt;&lt;em&gt;http://[hbase-server-host]:8484/quotes/OCZ&lt;/em&gt; gonna list all the entries of quotes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;strong&gt;5: Camel&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;And now let enter the Maestro&amp;#160;! Camel&amp;#160;!&lt;/p&gt;
&lt;p&gt;Camel is a wonderful tool, it emerged from ActiveMQ and is now a top project of Apache. It&amp;#8217;s main goal is the integration of services and that&amp;#8217;s what we get. HBase, Http request, Yahoo, all will be put in a perfect dance.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s start with the complete camel code and let&amp;#8217;s dig into the details&amp;#160;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;YahooFinanceRoute.java&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="brush: java"&gt;import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;

import com.ncp.processors.YahooParserProcessor;
import com.ncp.processors.YahooFinanceProcessor;

public class YahooFinanceRoute extends RouteBuilder {

	@Override
	public void configure() throws Exception {
		from("quartz://sources/yahoo_finance?cron=0+0+8+?+*+MON-FRI")
		.process(new YahooFinanceProcessor())
		.to("ahc:activate_yahoo")
		.convertBodyTo(String.class) 
		.split(body(String.class).tokenize("\n"))
		.process(new YahooParserProcessor()) 
		.transform(simple("${in.headers.Last}"))
		.setHeader(Exchange.HTTP_URI, constant("http://hbase-server:8484/quotes/{in.headers.Instr}/time:{in.headers.Time}"))
		.setHeader(Exchange.HTTP_METHOD, constant("POST"))
		.setHeader(Exchange.CONTENT_TYPE, constant("application/octet-stream"))
		.to("ahc:activate_hbase");
	}

}
&lt;/pre&gt;
&lt;p&gt;The event style programming&amp;#160;:&lt;/p&gt;
&lt;p&gt;Start a event every day from monday to friday at 8 AM&lt;/p&gt;
&lt;pre class="brush: java"&gt;from("quartz://sources/yahoo_finance?cron=0/8+*+*+*+*+?")&lt;/pre&gt;
&lt;p&gt;Use a processor to configure the URL using required instruments code&lt;/p&gt;
&lt;pre class="brush: java"&gt;.process(new YahooFinanceProcessor())&lt;/pre&gt;
&lt;p&gt;Use the async camel http component call the configured url&lt;/p&gt;
&lt;pre class="brush: java"&gt;.to("ahc:activate_yahoo")&lt;/pre&gt;
&lt;p&gt;The component will return a ByteArrayInputStream that need to be converted to a String&lt;/p&gt;
&lt;pre class="brush: java"&gt;.convertBodyTo(String.class) &lt;/pre&gt;
&lt;p&gt;Split the content to camel messages &lt;/p&gt;
&lt;pre class="brush: java"&gt;.split(body(String.class).tokenize("\n"))&lt;/pre&gt;
&lt;p&gt;Parse each instrument line and store required informations in the exchange headers&lt;/p&gt;
&lt;pre class="brush: java"&gt;.process(new YahooParserProcessor())&lt;/pre&gt;
&lt;p&gt;Transform the header of the message as the Body to be send in the Post request&lt;/p&gt;
&lt;pre class="brush: java"&gt;.transform(simple("${in.headers.Last}"))&lt;/pre&gt;
&lt;p&gt;Camel offers us a subtil tool as Simple, a language which can query the Exchange and offers others services. See more &lt;a href="http://camel.apache.org/simple.html" title="Camel Simple" target="_blank"&gt;here&lt;/a&gt;. For this part of the task I used simple to demonstrate how usefull it can be but you can also move all this part in a Processor if you want.&lt;/p&gt;
&lt;p&gt;Configure the request to be send as a POST, don&amp;#8217;t forget the content-type header.&lt;/p&gt;
&lt;pre class="brush: java"&gt;.setHeader(Exchange.HTTP_URI, constant("http://hbase-server:8484/quotes/{in.headers.Instr}/time:{in.headers.Time}"))
.setHeader(Exchange.HTTP_METHOD, constant("POST"))
.setHeader(Exchange.CONTENT_TYPE, constant("application/octet-stream"))&lt;/pre&gt;
&lt;p&gt;Send the orders to the Stargate&amp;#160;!&lt;/p&gt;
&lt;pre class="brush: java"&gt;.to("ahc:activate_hbase");
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;YahooFinanceProcessor.java&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="brush: java"&gt;import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.commons.lang.StringUtils;

public class YahooFinanceProcessor implements Processor {
	
       // just add the Yahoo Instrument code here
	final String[] quotes = new String[]{"OCZ","AMZN"};
	final String url_quotes = StringUtils.join(quotes, "+");

	@Override
	public void process(Exchange exchange) throws Exception {
		exchange.getIn().setHeader(Exchange.HTTP_URI, "http://download.finance.yahoo.com/d/quotes.csv?f=sl1d1t1ohgdr&amp;amp;s="+url_quotes+"&amp;amp;throwExceptionOnFailure=false");
	}
}
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;YahooParserProcessor .java&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="brush: java"&gt;import org.apache.camel.Exchange;
import org.apache.camel.Processor;

public class YahooParserProcessor implements Processor {

	@Override
	public void process(Exchange exchange) throws Exception {
		String[] datas = exchange.getIn().getBody(String.class).split(",");
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
		exchange.getIn().setHeader("Instr", datas[0].replaceAll("\"", ""));
		exchange.getIn().setHeader("Last", datas[1]);
		exchange.getIn().setHeader("Time", sdf.format(new Date()));
	}

}
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;6: Conclusion&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This conclude our integration, you can now setup your project and decide how-to start the route. For my own needs I use Spring. Don&amp;#8217;t forget to setup all the required jars&amp;#160;! &lt;/span&gt;&lt;/p&gt;</description><link>http://tech.robbieone.com/post/15341612892</link><guid>http://tech.robbieone.com/post/15341612892</guid><pubDate>Thu, 05 Jan 2012 12:16:00 +0100</pubDate><category>hbase</category><category>camel</category><category>rest</category></item><item><title>CloudExplorer</title><description>&lt;p&gt;&lt;strong&gt;Update &lt;/strong&gt;: this article was published in &lt;a href="http://fxexperience.com/2012/01/javafx-links-of-the-week-january-2/" title="CloudExplorer by Robert Felker on fxexperience.com" target="_blank"&gt;JavaFX links of the week, January 2&lt;/a&gt; in the reference site fxexperience.com. Thank you Jonathan&amp;#160;!&lt;/p&gt;
&lt;p&gt;Since i wanna jauge &lt;strong&gt;JavaFX2&lt;/strong&gt;, i&amp;#8217;ve written a quick and dirty &lt;strong&gt;scala&lt;/strong&gt; framework for &lt;strong&gt;charting&lt;/strong&gt;. It simply parse a csv file and can draw it as a point cloud or a chart. It offers&amp;#160;:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Interactive data selection&lt;/li&gt;
&lt;li&gt;Multiple selection and deselection&lt;/li&gt;
&lt;li&gt;Grouping ( select points and then Ctrl+num[0-9]) and recall of group&lt;/li&gt;
&lt;li&gt;Pan&lt;/li&gt;
&lt;li&gt;Zoom (disabled as Oracle removed support for wheel but active in the code)&lt;/li&gt;
&lt;li&gt;AutoGrid&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The two examples commands are : com.numbersam.cloud.ui.Cloud and com.numbersam.cloud.ui.Density&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt; : &lt;a href="https://github.com/Solido/CloudExplorer" target="_blank"&gt;&lt;a href="https://github.com/Solido/CloudExplorer" target="_blank"&gt;https://github.com/Solido/CloudExplorer&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;JavaFX2 is a wonderfull tool&amp;#160;! it&amp;#8217;s only opponent is Html5 Canvas but the framework is much more advanced. I guess than soon html will enjoy such powerfull tool.&lt;/p&gt;
&lt;p&gt;&lt;img align="middle" alt="Cloud" height="400" src="http://solaar.free.fr/cloudexplorer/cloudexplorer.png" width="500"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="312" src="http://solaar.free.fr/cloudexplorer/densityexplorer.png" width="500"/&gt;&lt;/p&gt;</description><link>http://tech.robbieone.com/post/15061289885</link><guid>http://tech.robbieone.com/post/15061289885</guid><pubDate>Sat, 31 Dec 2011 04:18:00 +0100</pubDate></item><item><title>HBase and the wrong base</title><description>&lt;p&gt;HBase is one the implementation of the Google BigTable concept and one of the most interesting project in my eyes. It offers storage for bigdata and a more reconfigurable datastructure. The main problem came from the installation. Since it require ssh, on windows even for testing is quite a mess and now i&amp;#8217;ve discovered that&amp;#8217;s it&amp;#8217;s not compatible with Ubuntu 11.xx. The only configuration I can get it works is Ubuntu 10.04 LTS and HBase 0.90.x.  &lt;/p&gt;</description><link>http://tech.robbieone.com/post/15057268600</link><guid>http://tech.robbieone.com/post/15057268600</guid><pubDate>Sat, 31 Dec 2011 02:54:00 +0100</pubDate><category>it</category></item></channel></rss>

