Spread Messaging Toolkit

Discussion in 'Automated Trading' started by WallstYouth, Feb 12, 2008.

  1. Spread is an open source toolkit that provides a high performance messaging service that is resilient to faults across local and wide area networks. Spread functions as a unified message bus for distributed applications, and provides highly tuned application-level multicast, group communication, and point to point support. Spread services range from reliable messaging to fully ordered messages with delivery guarantees.

    The API seems pretty straight forward for the most part I was able to startup the spread daemon and send a few test messages in a few minutes.

    [ Standard UNIX installation ]
    ./configure --prefix=/opt/spread && make && make install

    [ If using Java ]
    [wallstyouth@macbookpro:~/Desktop/spread-src-4.0.0/java] $ ant all
    $ cp spread.jar /opt/spread/lib

    The default configuration is good enough for basic testing
    [wallstyouth@macbookpro:/opt/spread/etc] $ egrep '^[^#]' spread.conf
    Spread_Segment {

    Really quick code to just show you how easy it is to construct messages. Here I send a test message to the spread daemon on port 4803

    1. Startup the spread daemon /opt/spread/sbin/spread &

    2. Startup the spuser utility this is a handy utility to monitor and send/recieve messages
    a. Startup spuser utility : ./spuser
    b. Join a group that will receive messages from clients : j group1

    Using the following I was able to compile and send a message to the spread daemon and see this message register in the spuser utility.

    javac -cp /path/to/spread.jar SpreadExample.java

    --- SpreadExample.java ---
    import spread.*;
    import java.net.InetAddress;
    import java.io.*;
     * User: wallstyouth
     * Date: Feb 10, 2008
     * Time: 12:46:18 PM
    public class SpreadExample  {
        public static void main(String[] args) throws IOException, SpreadException {
            String text = "Hello spread clients";
            SpreadVersion ver = new SpreadVersion();
            SpreadMessage msgbox = new SpreadMessage();
            SpreadGroup group = new SpreadGroup();
            StringBuffer  msg = new StringBuffer();
            SpreadConnection connection = new SpreadConnection();
            InetAddress sp_host = InetAddress.getByName("");
            /* join a group on the connection */
            msg.append(" [spread/");
            /* Send the msg data */
    I recently came across this toolkit and it seems well polished with a decent following, I might end up using it some of our projects just thought I would share this with others.
  2. rosy2


    i used this years ago but there's no persistence. you can not get the last 50 messages if you needed.

    i use activemq personally and sonic at work.