<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
<!--
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
@font-face
        {font-family:Tahoma}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
p
        {margin-right:0in;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif"}
span.EmailStyle18
        {font-family:"Calibri","sans-serif";
        color:#1F497D}
.MsoChpDefault
        {}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
div.WordSection1
        {}
-->
</style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Only using one connection is the point of this modification.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"><br>
I already have a setup that does an asynchronous call that instantiates a Pika Publisher to publish a message to the queue, and a Pika Monitor to consume messages. However those each create their own connection and ioloops.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Am I chasing my tail trying to get multiple channels created for a single connection? Then creating a queue on each channel, one to monitor, one to publish
to?</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Or is there some other more elegant solution to this? Looking to keep the number of connections to RabbitMQ down on a per application basis.
</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">-Christopher Lefevre</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> Gavin M. Roy [mailto:gmr@myyearbook.com]
<br>
<b>Sent:</b> Wednesday, September 07, 2011 2:38 PM<br>
<b>To:</b> Christopher Lefevre<br>
<b>Cc:</b> Marek Majkowski; rabbitmq-discuss@lists.rabbitmq.com<br>
<b>Subject:</b> Re: [rabbitmq-discuss] Publish on a queue, then Monitor on a reply queue, with only 1 connection to the RabbitMQ server? Non-blocking?</span></p>
</div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">You can have multiple connections with one IO loop, assuming you're using PIka. In that case, the IOloop is a single instance across all connections, so you should setup both your connections before starting it, or use a timer to call a
method after starting it that sets up your connections.</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Gavin</p>
</div>
<p><span style="color:#A0A0A8">On Wednesday, September 7, 2011 at 2:02 PM, Christopher Lefevre wrote:</span></p>
<blockquote style="border:none; border-left:solid windowtext 1.0pt; padding:0in 0in 0in 8.0pt; margin-left:0in; margin-top:5.0pt; margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal">EXACTLY!<br>
<br>
That's the bit that I'm getting stuck on.<br>
<br>
I have a publish method that sets up a connection, then calls another function to open a channel, then publishes to the queue as shown previously.<br>
<br>
Within that function is a connection.ioloop.start() which I guess I don't really understand. For the individual publish/monitor functions they work as expected, the monitor will monitor and consume, while the publish only publishes once and breaks the ioloop,
as expected.<br>
<br>
To get an asynchronous Publish, then Monitor the reply_to queue, I can instantiate the classes for the monitor/publisher I have, and it will work with 2 connections to the server. However trying to get this done with one connection is where I'm balking.<br>
<br>
-Christopher Lefevre<br>
<br>
<br>
-----Original Message-----<br>
From: Marek Majkowski [<a href="mailto:majek04@gmail.com">mailto:majek04@gmail.com</a>]<br>
Sent: Wednesday, September 07, 2011 11:45 AM<br>
To: Christopher Lefevre<br>
Cc: <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
Subject: Re: [rabbitmq-discuss] Publish on a queue, then Monitor on a reply queue, with only 1 connection to the RabbitMQ server? Non-blocking?<br>
<br>
On Wed, Sep 7, 2011 at 14:21, Christopher Lefevre<br>
<<a href="mailto:CLefevre@transparent.com">CLefevre@transparent.com</a>> wrote:<br>
<br>
</p>
<div>
<p class="MsoNormal">Coming back to this after a day I realize throughout I was a bit off in describing my situation. I am actually attempting to get an asynchronous setup to work on one connection to the RabbitMQ server.<br>
<br>
Connect, create a channel(s), publish to a queue, then monitor on the reply queue, in an asynchronous state, returning the reply to a web page when completed.</p>
</div>
<p class="MsoNormal"><br>
Well, if you want to use asynchronous style, than you need to have<br>
an event loop and program using callbacks.<br>
<br>
Cheers,<br>
Marek<br>
The information contained in this electronic message and any attached document(s) is intended only for the personal and confidential use of the designated recipients named above. This message may be confidential. If the reader of this message is not the intended
recipient, you are hereby notified that you have received this document in error, and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify sender immediately
by telephone (603) 262-6300 or by electronic mail immediately. Thank you.<br>
_______________________________________________<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">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"> </p>
</div>
</div>
The information contained in this electronic message and any attached document(s) is intended only for the personal and confidential use of the designated recipients named above. This message may be confidential. If the reader of this message is not the intended
recipient, you are hereby notified that you have received this document in error, and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify sender immediately
by telephone (603) 262-6300 or by electronic mail immediately. Thank you.
</body>
</html>