Changeset 4107

Show
Ignore:
Timestamp:
10/08/07 00:10:00 (1 year ago)
Author:
sylvain.hellegouarch
Message:

Added first try at the Messaging API

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/nuxleus/Scripts/llup-pub.sh

    r3980 r4107  
    4242  echo "Starting the llup publisher server on port $PORT against queue server at $QUEUE_SERVER and monitoring $2" 
    4343  # add -v to the line below to enable logging to the console 
    44    llup-queue-publisher.py -v -s $QUEUE_SERVER -q $2 -i $PID_FILE -f 5.0 & 
     44   llup-queue-publisher.py -s $QUEUE_SERVER -q $2 -i $PID_FILE -f 5.0 & 
    4545;; 
    4646 
  • trunk/nuxleus/src/Nuxleus.PubSub/Bucker/message.cs

    r4089 r4107  
    232232 
    233233    [XmlElement (ElementName="op", Type=typeof(Operation))] 
    234     public Operation Op = null
     234    public Operation Op = new Operation()
    235235 
    236236    [XmlElement (ElementName="error", Type=typeof(Error))] 
     
    251251      XmlSerializer serializer = new XmlSerializer(typeof(Message)); 
    252252      return (Message)serializer.Deserialize(stream); 
     253    } 
     254 
     255    public static Message Parse(byte[] bytes) { 
     256      MemoryStream stream = new MemoryStream(bytes); 
     257      XmlSerializer serializer = new XmlSerializer(typeof(Message)); 
     258      Message m = (Message)serializer.Deserialize(stream); 
     259      stream.Close(); 
     260      return m; 
    253261    } 
    254262 
     
    267275      return sb.ToString(); 
    268276    } 
     277 
     278    public static byte[] Serialize(Message message) { 
     279      return Encoding.UTF8.GetBytes(message.ToString()); 
     280    } 
     281 
     282    public static byte[] Serialize(Message message, Encoding encoding) { 
     283      return encoding.GetBytes(message.ToString()); 
     284    } 
    269285  } 
    270286} 
  • trunk/nuxleus/src/Nuxleus.PubSub/Bucker/queueclient.cs

    r4089 r4107  
    260260          ms.Data.Append(Encoding.UTF8.GetString(ms.Buffer, 0, bytesRead)); 
    261261          try { 
    262             Message m = Message.Parse(ms.Data.ToString()); 
     262            char[] charsToTrim = {'\r', '\n'}; 
     263            Message m = Message.Parse(ms.Data.ToString().TrimEnd(charsToTrim)); 
    263264            ms.OnMessageReceived(new MessageStateEventArgs(m)); 
    264265          } catch (XmlException xe) { 
  • trunk/nuxleus/src/Xameleon/Function/QueueManager.cs

    r4089 r4107  
    1818          // The actual Queue Message to send 
    1919          Message pm = new Message(); 
    20           pm.Op = new Operation(); 
    2120          pm.Op.Type = OperationType.PushMessage; 
    2221          pm.QueueId = queueName; 
  • trunk/nuxleus/src/nux.build

    r4103 r4107  
    266266      </references> 
    267267    </csc> 
    268   </target> 
     268  </target>   
    269269  <target name="Nuxleus.Logging" depends="init"> 
    270270    <csc target="library" output="${build.dir}/Nuxleus.Logging.dll"> 
     
    278278    </csc> 
    279279  </target> 
    280   <target name="Nuxleus.Messaging" depends="init"> 
     280<<<<<<< .mine 
     281  <target name="Nuxleus.Messaging" depends="init Nuxleus.PubSub"> 
    281282    <csc target="library" output="${build.dir}/Nuxleus.Messaging.dll"> 
    282283      <sources> 
     
    286287        <include name="System.dll"/> 
    287288        <include name="System.Xml.dll"/> 
     289        <include name="${build.dir}/Nuxleus.PubSub.dll"/> 
     290        <include name="${dependencies.dir}/ALAZ.SystemEx.NetEx.dll"/> 
     291        <include name="${dependencies.dir}/ALAZ.SystemEx.dll"/> 
    288292      </references> 
    289293    </csc>