I have a couple messaging scenarios I need help with... <div>1) I would like to have a subscriber listening to "raw" queue; then do some preprocessing and publish a new message, such as "preprocessed" to the same exchange.</div>
<div>2) I would also like to have a subscriber that would process and push to a different exchange.</div><div><br></div><div>I noticed in the .Net Client User Guide that it says do not call .basicPublish during a callback as it blocks threads. </div>
<div><br></div><div><div><font class="Apple-style-span" color="#3366FF">using (IConnection conn = connectionFactory.CreateConnection())</font></div><div><font class="Apple-style-span" color="#3366FF">{</font></div><div><font class="Apple-style-span" color="#3366FF"> using (IModel model = conn.CreateModel())</font></div>
<div><font class="Apple-style-span" color="#3366FF"> {</font></div><div><font class="Apple-style-span" color="#3366FF"> var sub = new Subscription(model, "rtls");</font></div><div><font class="Apple-style-span" color="#3366FF"> foreach (BasicDeliverEventArgs iter in sub)</font></div>
<div><font class="Apple-style-span" color="#3366FF"> {</font></div><div><font class="Apple-style-span" color="#3366FF"> var message = System.Text.Encoding.UTF8.GetString(iter.Body);</font></div><div><font class="Apple-style-span" color="#3366FF"> </font><font class="Apple-style-span" color="#CC0000"> //want to crunch and publish to different exchange or same exchange</font></div>
<div><font class="Apple-style-span" color="#CC0000"> // ***.BasicPublish(...);</font></div><div><font class="Apple-style-span" color="#CC0000"><br></font></div><div><font class="Apple-style-span" color="#3366FF"> sub.Ack(iter);</font></div>
<div><font class="Apple-style-span" color="#3366FF"> }</font></div><div><font class="Apple-style-span" color="#3366FF"><br></font></div><div><font class="Apple-style-span" color="#3366FF"> }</font></div><div><font class="Apple-style-span" color="#3366FF">}</font></div>
</div><div><font class="Apple-style-span" color="#3366FF"><br></font></div><div><font class="Apple-style-span" color="#3366FF"><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">I would like to successfully process and publish the new message before I send the ack() on the original message; just so I'm sure every message is processed.</span></font></div>
<div><font class="Apple-style-span" color="#3366FF"><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><br></span></font></div><div><font class="Apple-style-span" color="#3366FF"><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">Is this the proper way to process or will that cause threading issues?</span></font></div>
<div><font class="Apple-style-span" color="#3366FF"><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><br></span></font></div><div><font class="Apple-style-span" color="#3366FF"><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">Thank you,</span></font></div>
<div><font class="Apple-style-span" color="#3366FF"><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">Dave</span></font></div>