<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'd like to use binary Json, and there'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'll find it's the same set of steps for anything that inherits from "object" (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"><<a href="mailto:chenhouwu@gmail.com">chenhouwu@gmail.com</a>></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 <<a href="mailto:maje...@gmail.com">maje...@gmail.com</a>> wrote:<br>> Hi,<br>><br>> I think you should be using some standardized encoding,<br>
> like for example json.<br>><br></div>> 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>
><br>> Cheers,<br>> Marek<br>
<div>
<div></div>
<div class="h5">><br>><br>><br>><br>><br>><br>><br>><br>><br>> On Mon, Dec 27, 2010 at 11:22, Chen Houwu <<a href="mailto:chenho...@gmail.com">chenho...@gmail.com</a>> wrote:<br>> > I am a newbie to rabbitmq, I want to send a message object as<br>
> > following via .net client:<br>><br>> > public class Message<br>> > {<br>> > public int ID { get; set; }<br>> > public string Name { get; set; }<br>> > public byte[] Binary { get; set; }<br>
> > public string[] Infos{get;set;}<br>> > public Dictionary<string,int> CountMap { get; set; }<br>> > }<br>><br>> > Here is my code:<br>> > -------------------------------------------<br>
> > var builder = new<br>> > RabbitMQ.Client.Content.StreamMessageBuilder(_channel);<br>> > builder.writeObject(msg.ID);<br>> > builder.writeObject(msg.Name);<br>> > /*----------How to deal with msg.Infos and CountMap here?------------/<br>
><br>> > /*shoud it be written by myself such as: */<br>> > builder.writeObject(infos.count)<br>> > foreach(var info in infos)<br>> > {<br>> > builder.writerObject(info)<br>> > }<br>
> > /* or the suporting to array and dictionary already exists?*/<br>><br>> > /* I have found in"src/client/impl/WireFormatting.cs", there are<br>> > methods like "WriteArray", and "WriteTable"*/<br>
><br>> > IBasicProperties props = _channel.CreateBasicProperties();<br>> > props.DeliveryMode = 2;<br>> > _channel.BasicPublish(_exchangeName, "some key", props,<br>> > builder.GetContentBody());<br>
> > -----------------<br>><br>> > _______________________________________________<br>> > rabbitmq-discuss mailing list<br></div></div>> > <a href="mailto:rabbitmq-disc...@lists.rabbitmq.com">rabbitmq-disc...@lists.rabbitmq.com</a><br>
<div class="im">> ><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>><br>> _______________________________________________<br>
> rabbitmq-discuss mailing list<br></div>> 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>