<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I apologize if you get a duplicate of this�I sent from the wrong account last time:</div><div><br></div>I find these samples to be a little simplistic.<br><br>1. They never include heartbeat settings, and the .NET documentation is&nbsp;pretty thin on these as well. &nbsp;Setting a heartbeat is pretty important,&nbsp;otherwise if there is a network problem and your client loses connectivity,&nbsp;neither your client or the message broker seem to know about it. &nbsp;Samples&nbsp;never seem to do this.<br>2. They never include error handling - there are some useful exceptions&nbsp;raised if connections drop, killing a subscription.<br>3. They never include multithreading concerns. &nbsp;It isn't always possible or&nbsp;efficient to spin up multiple consumer processes to achieve concurrency.&nbsp;It seems important to note that sharing a Connection is OK (and probably a&nbsp;good thing since Connections use a limited OS resource), but sharing a&nbsp;Model is not OK. &nbsp;From 2.10 of the API guide:<br><br>If more than one thread needs to access a particular IModel instances, the&nbsp;application should enforce mutual exclusion itself. One way of achieving&nbsp;this is for all users of an IModel to lock the instance itself:<br>IModel ch = RetrieveSomeSharedIModelInstance();<br>lock (ch) {<br>ch.BasicPublish(...);<br>}<br><br>I wish these samples and/or documentation would go into more detail about these scenarios. &nbsp;I've figured them out through trial and error or reading through driver code.<br><div><div><br></div><div>On Jul 23, 2012, at 9:35 AM, Christoph wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I'm not sure if you have already found these, but there are also Code Examples of the book "RabbitMQ in Action" available on GitHub:&nbsp;
<a href="https://github.com/rabbitinaction/sourcecode/tree/master/csharp/appendix-a">https://github.com/rabbitinaction/sourcecode/tree/master/csharp/appendix-a</a>_______________________________________________<br>rabbitmq-discuss mailing list<br><a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss<br></blockquote></div><br></body></html>