gzip stream support for rhino queues

18 views
Skip to first unread message

ozanyurt

unread,
Oct 30, 2012, 10:29:43 AM10/30/12
to rhino-t...@googlegroups.com
Hi,

I'm try to add gzip support for message transport. I'm successfully add .net gzipstream for OutgoingMessageInformation used IMessageBuilder<MessagePayload> interface. I need to decompress this message payload. I can decompress message on RhinoQueuesTransport.DeserializeMessages before send to XmlDeserializer check the header if message is compressed then I decompress message.Data. 

 if (message.Headers["IWasCompressed"] == "true")
                {
                    using (var bigStream = new GZipStream(new MemoryStream(message.Data), CompressionMode.Decompress))
                    {
                        var bigStreamOut = new MemoryStream();
                        bigStream.CopyTo(bigStreamOut);
                        logger.DebugFormat("message.Data size before compression: {0}", message.Data.Length);
                        message.Data = bigStreamOut.ToArray();
                        logger.DebugFormat("message.Data size after compression: {0}", message.Data.Length);
                    }
                }

Any other ways to do this like CustomMessageBuilder. 

Thanks
Ozan

Corey Kaylor

unread,
Nov 2, 2012, 11:11:28 AM11/2/12
to rhino-t...@googlegroups.com
If base64 string is good enough for you in most cases, an ICustomElementSerializer would do the trick. Otherwise a custom serializer would be needed, possibly just wrapping the existing one.


--
You received this message because you are subscribed to the Google Groups "Rhino Tools Dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rhino-tools-dev/-/4oh_UzqUlo4J.
To post to this group, send email to rhino-t...@googlegroups.com.
To unsubscribe from this group, send email to rhino-tools-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rhino-tools-dev?hl=en.

Reply all
Reply to author
Forward
0 new messages