You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Ted Ross <tr...@redhat.com> on 2010/01/21 15:56:16 UTC

Queue-purge and alternate exchanges

I was doing some testing on the C++ broker and discovered that if you 
purge messages from a queue (using the management method Queue.purge) 
that has an alternate exchange configured, the messages are simply 
deleted.  They are not sent to the alternate exchange.

I'm planning to fix this because there are valuable use cases for being 
able to dump some or all of the messages from a queue into an alternate 
exchange (rather than deleting and re-creating the queue).  The question 
I have for the Devs is this:  Should purge always use the alt-exchange 
if present?  Should this management method be left alone and a new 
"purge-alt" be added that uses alt-exchange?  Is there a case where it 
is desirable to remove messages and not send them to the configured 
alt-exchange?

Thanks,

-Ted


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Queue-purge and alternate exchanges

Posted by Rafael Schloming <ra...@redhat.com>.
Ted Ross wrote:
> On 01/25/2010 09:39 AM, Rafael Schloming wrote:
>> Alan Conway wrote:
>>> On 01/22/2010 02:34 PM, Carl Trieloff wrote:
>>>>
>>>>
>>>> I would add a purge-safe or something like that which does what you say
>>>> purge-alt does in your text. purge-alt makes you think you are
>>>> purging the queue associated with the alt.
>>>
>>> How about purge-to-alt?
>>
>> We could also just add an argument to purge controlling the behavior, 
>> could we not?
>>
>> It also seems like purge-to-alt is equivalent in implementation to a 
>> move-all(from, to) command, and yet unnecessarily more restricted. I 
>> would be tempted to leave purge as it is and consider adding a fancier 
>> move command as above.
> Move-all is from queue to queue.  This is more of a move from queue to 
> exchange.  The purged messages may not all get re-routed to the same 
> destination queue.  Perhaps the method you are envisioning is "reroute".

Sure, my point was just that you may as well supply the destination as 
an argument rather than hard-coding it to always go to the alternate 
exchange.

--Rafael


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Queue-purge and alternate exchanges

Posted by Ted Ross <tr...@redhat.com>.
On 01/25/2010 09:39 AM, Rafael Schloming wrote:
> Alan Conway wrote:
>> On 01/22/2010 02:34 PM, Carl Trieloff wrote:
>>>
>>>
>>> I would add a purge-safe or something like that which does what you say
>>> purge-alt does in your text. purge-alt makes you think you are
>>> purging the queue associated with the alt.
>>
>> How about purge-to-alt?
>
> We could also just add an argument to purge controlling the behavior, 
> could we not?
>
> It also seems like purge-to-alt is equivalent in implementation to a 
> move-all(from, to) command, and yet unnecessarily more restricted. I 
> would be tempted to leave purge as it is and consider adding a fancier 
> move command as above.
Move-all is from queue to queue.  This is more of a move from queue to 
exchange.  The purged messages may not all get re-routed to the same 
destination queue.  Perhaps the method you are envisioning is "reroute".

-Ted


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Queue-purge and alternate exchanges

Posted by Robert Godfrey <ro...@gmail.com>.
2010/1/25 Rafael Schloming <ra...@redhat.com>:
> Alan Conway wrote:
>>
>> On 01/22/2010 02:34 PM, Carl Trieloff wrote:
>>>
>>>
>>> I would add a purge-safe or something like that which does what you say
>>> purge-alt does in your text. purge-alt makes you think you are
>>> purging the queue associated with the alt.
>>
>> How about purge-to-alt?
>
> We could also just add an argument to purge controlling the behavior, could
> we not?
>
> It also seems like purge-to-alt is equivalent in implementation to a
> move-all(from, to) command, and yet unnecessarily more restricted. I would
> be tempted to leave purge as it is and consider adding a fancier move
> command as above.
>

I tend to agree...

If I invoke "purge" I expect it to do what it says on the tin - purge
the messages
If I want to "move" messages that is something different

-- Rob

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Queue-purge and alternate exchanges

Posted by Rafael Schloming <ra...@redhat.com>.
Alan Conway wrote:
> On 01/22/2010 02:34 PM, Carl Trieloff wrote:
>>
>>
>> I would add a purge-safe or something like that which does what you say
>> purge-alt does in your text. purge-alt makes you think you are
>> purging the queue associated with the alt.
> 
> How about purge-to-alt?

We could also just add an argument to purge controlling the behavior, 
could we not?

It also seems like purge-to-alt is equivalent in implementation to a 
move-all(from, to) command, and yet unnecessarily more restricted. I 
would be tempted to leave purge as it is and consider adding a fancier 
move command as above.

--Rafael


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Queue-purge and alternate exchanges

Posted by Alan Conway <ac...@redhat.com>.
On 01/22/2010 02:34 PM, Carl Trieloff wrote:
>
>
> I would add a purge-safe or something like that which does what you say
> purge-alt does in your text. purge-alt makes you think you are
> purging the queue associated with the alt.

How about purge-to-alt?

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Queue-purge and alternate exchanges

Posted by Carl Trieloff <cc...@redhat.com>.

I would add a purge-safe  or something like that which does what you say 
purge-alt does in your text.  purge-alt makes you think you are
purging the queue associated with the alt.

Carl.


On 01/21/2010 09:56 AM, Ted Ross wrote:
> I was doing some testing on the C++ broker and discovered that if you 
> purge messages from a queue (using the management method Queue.purge) 
> that has an alternate exchange configured, the messages are simply 
> deleted.  They are not sent to the alternate exchange.
>
> I'm planning to fix this because there are valuable use cases for 
> being able to dump some or all of the messages from a queue into an 
> alternate exchange (rather than deleting and re-creating the queue).  
> The question I have for the Devs is this:  Should purge always use the 
> alt-exchange if present?  Should this management method be left alone 
> and a new "purge-alt" be added that uses alt-exchange?  Is there a 
> case where it is desirable to remove messages and not send them to the 
> configured alt-exchange?
>
> Thanks,
>
> -Ted
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org