<div>Hi Chen,</div>
<div> </div>
<div>I like binary serialization at the moment.</div>
<div> </div>
<div><a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.formatter.aspx">http://msdn.microsoft.com/en-us/library/system.runtime.serialization.formatter.aspx</a></div>
<div> </div>
<div>In future I&#39;d like to use binary Json, and there&#39;s also google protobuffers which look pretty good (not sure on how good the .net support is though).  Json is certainly better IMHO than XML. The binary / cross-platform binary options are more suited to my purposes.  </div>

<div> </div>
<div>Under .net Json / Binary / Soap serialization works just about the same way.</div>
<div> </div>
<div><a href="http://pietschsoft.com/post/2008/02/NET-35-JSON-Serialization-using-the-DataContractJsonSerializer.aspx">http://pietschsoft.com/post/2008/02/NET-35-JSON-Serialization-using-the-DataContractJsonSerializer.aspx</a></div>

<div><br>Start off serializing / deserializing an object with one property. Get that going and you&#39;ll find it&#39;s the same set of steps for anything that inherits from &quot;object&quot; (includes arrays).  Tag it up / decorate it correctly, and job done.  Step two, see if Rabbit handles it faithfully (it does for me).</div>

<div> </div>
<div>cheers,</div>
<div>-Steven<br></div>
<div class="gmail_quote">On 4 January 2011 08:27, Chen Houwu <span dir="ltr">&lt;<a href="mailto:chenhouwu@gmail.com">chenhouwu@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Do you mean that .net client has no build-in support for simple data<br>structure?<br>But I have found it should support according to the AMQP 1.0<br>
specification.<br>AMQP is a binary protocol, but json is text.<br>Though I can send binary content after encoding it to BASE64, it is<br>too inefficient.<br><br>It seams as if the python client support array and dictionary<br>
object.....<br>
<div class="im"><br>On 2010年12月29日, 下午6时47分, Marek Majkowski &lt;<a href="mailto:maje...@gmail.com">maje...@gmail.com</a>&gt; wrote:<br>&gt; Hi,<br>&gt;<br>&gt; I think you should be using some standardized encoding,<br>
&gt; like for example json.<br>&gt;<br></div>&gt; Take a look at this library:<a href="http://james.newtonking.com/pages/json-net.aspxhttp://stackoverflow.com/questions/571168/what-json-library-works-wel." target="_blank">http://james.newtonking.com/pages/json-net.aspxhttp://stackoverflow.com/questions/571168/what-json-library-works-wel.</a>..<br>
&gt;<br>&gt; Cheers,<br>&gt;   Marek<br>
<div>
<div></div>
<div class="h5">&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; On Mon, Dec 27, 2010 at 11:22, Chen Houwu &lt;<a href="mailto:chenho...@gmail.com">chenho...@gmail.com</a>&gt; wrote:<br>&gt; &gt;   I am a newbie to rabbitmq, I want to send a message object as<br>
&gt; &gt; following via .net client:<br>&gt;<br>&gt; &gt;   public class Message<br>&gt; &gt;    {<br>&gt; &gt;        public int ID { get; set; }<br>&gt; &gt;        public string Name { get; set; }<br>&gt; &gt;        public byte[] Binary { get; set; }<br>
&gt; &gt;        public string[] Infos{get;set;}<br>&gt; &gt;        public Dictionary&lt;string,int&gt; CountMap { get; set; }<br>&gt; &gt;    }<br>&gt;<br>&gt; &gt; Here is my code:<br>&gt; &gt; -------------------------------------------<br>
&gt; &gt; var builder = new<br>&gt; &gt; RabbitMQ.Client.Content.StreamMessageBuilder(_channel);<br>&gt; &gt; builder.writeObject(msg.ID);<br>&gt; &gt; builder.writeObject(msg.Name);<br>&gt; &gt; /*----------How to deal with msg.Infos and CountMap here?------------/<br>
&gt;<br>&gt; &gt; /*shoud it be written by myself such as: */<br>&gt; &gt; builder.writeObject(infos.count)<br>&gt; &gt; foreach(var info in infos)<br>&gt; &gt; {<br>&gt; &gt;   builder.writerObject(info)<br>&gt; &gt; }<br>
&gt; &gt; /* or the suporting to array and dictionary already exists?*/<br>&gt;<br>&gt; &gt; /* I have found in&quot;src/client/impl/WireFormatting.cs&quot;, there are<br>&gt; &gt; methods like &quot;WriteArray&quot;, and &quot;WriteTable&quot;*/<br>
&gt;<br>&gt; &gt;  IBasicProperties props = _channel.CreateBasicProperties();<br>&gt; &gt; props.DeliveryMode = 2;<br>&gt; &gt;  _channel.BasicPublish(_exchangeName, &quot;some key&quot;, props,<br>&gt; &gt; builder.GetContentBody());<br>
&gt; &gt; -----------------<br>&gt;<br>&gt; &gt; _______________________________________________<br>&gt; &gt; rabbitmq-discuss mailing list<br></div></div>&gt; &gt; <a href="mailto:rabbitmq-disc...@lists.rabbitmq.com">rabbitmq-disc...@lists.rabbitmq.com</a><br>

<div class="im">&gt; &gt;<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>&gt;<br>&gt; _______________________________________________<br>
&gt; rabbitmq-discuss mailing list<br></div>&gt; rabbitmq-disc...@lists.rabbitmq.comhttps://<a href="http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>

<div>
<div></div>
<div class="h5">_______________________________________________<br>rabbitmq-discuss mailing list<br><a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br><a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</div></div></blockquote></div><br>