Re: How to create an exclusive queue?

2013-12-26 Thread Marcelo Vieira

On 10-12-2013 20:46, Ted Ross wrote:


On 12/10/2013 05:54 AM, Gordon Sim wrote:

On 12/09/2013 06:50 PM, Marcelo Vieira wrote:

On 09-12-2013 16:22, Gordon Sim wrote:

On 12/09/2013 06:18 PM, Marcelo Vieira wrote:


In the script running as a daemon that read the messages, I'm using
'my_queue; {create:always, link:{x-subscribe:{exclusive:true}}}'

The senders are using the address: my_queue; {node: {type: 
queue}} on

the method createReceiver to open the session with the broker.


Why are they calling createReceiver()?


Sorry, I made a mistake. They call createSender().


When I execute the sender script, I get a message like this: Error
while sending broker message. resource-locked: resource-locked: Queue
my_queue has an exclusive consumer. No more consumers allowed.
(qpid/broker/Queue.cpp:414)


This sounds like it is working as expected, it is preventing further
consumers. The question is where those other consumers are coming 
from...



Yes, but this is preventing senders also.


You are getting the error above when calling createSender()? What 
version are you using?
Yeah, the error ocurred when calling createSender(). I'm using the 0.14 
version of qpid.


In another test I performed, when I created a new queue e started the 
daemon, I noticed that even after the stop of the daemon I was unable to 
make a new connection with neither sender or receiver. I was getting the 
error message of resource-locked all the time, and no other consumer has 
been started.


It was only possible to recreate senders or receivers after removing the 
queue and create it again. Is there a way to close all active 
connections or monitor the consumers?




Is it possible that you are attempting to create the sender after 
having failed to create a receiver on the same session?  In AMQP 0-10, 
session failures are sticky.  Any subsequent operation on the 
session will result in the reporting of the original error.




I've tried consuming (using drain example) with 'my-queue; 
{create:always, link:{x-subscribe:{exclusive:True}}}' and sending 
(with spout example) using 'my-queue; {node: {type: queue}}' against 
brokers from 0.22, 0.24 and trunk and can't reproduce any errors.


I think there must somehow be some other consumer. The error above 
comes from a path where consumption is set up.



-
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org



Re: How to create an exclusive queue?

2013-12-10 Thread Gordon Sim

On 12/09/2013 06:50 PM, Marcelo Vieira wrote:

On 09-12-2013 16:22, Gordon Sim wrote:

On 12/09/2013 06:18 PM, Marcelo Vieira wrote:


In the script running as a daemon that read the messages, I'm using
'my_queue; {create:always, link:{x-subscribe:{exclusive:true}}}'

The senders are using the address: my_queue; {node: {type: queue}} on
the method createReceiver to open the session with the broker.


Why are they calling createReceiver()?


Sorry, I made a mistake. They call createSender().


When I execute the sender script, I get a message like this: Error
while sending broker message. resource-locked: resource-locked: Queue
my_queue has an exclusive consumer. No more consumers allowed.
(qpid/broker/Queue.cpp:414)


This sounds like it is working as expected, it is preventing further
consumers. The question is where those other consumers are coming from...


Yes, but this is preventing senders also.


You are getting the error above when calling createSender()? What 
version are you using?


I've tried consuming (using drain example) with 'my-queue; 
{create:always, link:{x-subscribe:{exclusive:True}}}' and sending (with 
spout example) using 'my-queue; {node: {type: queue}}' against brokers 
from 0.22, 0.24 and trunk and can't reproduce any errors.


I think there must somehow be some other consumer. The error above comes 
from a path where consumption is set up.



-
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org



Re: How to create an exclusive queue?

2013-12-10 Thread Ted Ross


On 12/10/2013 05:54 AM, Gordon Sim wrote:

On 12/09/2013 06:50 PM, Marcelo Vieira wrote:

On 09-12-2013 16:22, Gordon Sim wrote:

On 12/09/2013 06:18 PM, Marcelo Vieira wrote:


In the script running as a daemon that read the messages, I'm using
'my_queue; {create:always, link:{x-subscribe:{exclusive:true}}}'

The senders are using the address: my_queue; {node: {type: 
queue}} on

the method createReceiver to open the session with the broker.


Why are they calling createReceiver()?


Sorry, I made a mistake. They call createSender().


When I execute the sender script, I get a message like this: Error
while sending broker message. resource-locked: resource-locked: Queue
my_queue has an exclusive consumer. No more consumers allowed.
(qpid/broker/Queue.cpp:414)


This sounds like it is working as expected, it is preventing further
consumers. The question is where those other consumers are coming 
from...



Yes, but this is preventing senders also.


You are getting the error above when calling createSender()? What 
version are you using?


Is it possible that you are attempting to create the sender after having 
failed to create a receiver on the same session?  In AMQP 0-10, session 
failures are sticky.  Any subsequent operation on the session will 
result in the reporting of the original error.




I've tried consuming (using drain example) with 'my-queue; 
{create:always, link:{x-subscribe:{exclusive:True}}}' and sending 
(with spout example) using 'my-queue; {node: {type: queue}}' against 
brokers from 0.22, 0.24 and trunk and can't reproduce any errors.


I think there must somehow be some other consumer. The error above 
comes from a path where consumption is set up.



-
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org



Re: How to create an exclusive queue?

2013-12-09 Thread Gordon Sim

On 12/09/2013 06:18 PM, Marcelo Vieira wrote:


In the script running as a daemon that read the messages, I'm using
'my_queue; {create:always, link:{x-subscribe:{exclusive:true}}}'

The senders are using the address: my_queue; {node: {type: queue}} on
the method createReceiver to open the session with the broker.


Why are they calling createReceiver()?


When I execute the sender script, I get a message like this: Error
while sending broker message. resource-locked: resource-locked: Queue
my_queue has an exclusive consumer. No more consumers allowed.
(qpid/broker/Queue.cpp:414)


This sounds like it is working as expected, it is preventing further 
consumers. The question is where those other consumers are coming from...


-
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org



Re: How to create an exclusive queue?

2013-12-09 Thread Marcelo Vieira

On 09-12-2013 16:22, Gordon Sim wrote:

On 12/09/2013 06:18 PM, Marcelo Vieira wrote:


In the script running as a daemon that read the messages, I'm using
'my_queue; {create:always, link:{x-subscribe:{exclusive:true}}}'

The senders are using the address: my_queue; {node: {type: queue}} on
the method createReceiver to open the session with the broker.


Why are they calling createReceiver()?


Sorry, I made a mistake. They call createSender().


When I execute the sender script, I get a message like this: Error
while sending broker message. resource-locked: resource-locked: Queue
my_queue has an exclusive consumer. No more consumers allowed.
(qpid/broker/Queue.cpp:414)


This sounds like it is working as expected, it is preventing further 
consumers. The question is where those other consumers are coming from...



Yes, but this is preventing senders also.

-
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org



Re: How to create an exclusive queue?

2013-12-07 Thread Fraser Adams

On 06/12/13 18:59, Darryl L. Pierce wrote:

On Fri, Dec 06, 2013 at 06:15:52PM +, Gordon Sim wrote:

So actually a better suggestion might be, e.g.:

'my-queue; {create:always, link:{x-subscribe:{exclusive:True}}}'

QQ - does create:always recreate the queue each time, even if it already
exists?

No, if the queue already exists it is reused (and messages that have 
built up on it can be consumed).


One of the things I got bitten with when I first started using Qpid was 
when I created queues and bindings on demand via address strings. So 
If I had one binding and I changed it (say when I was tinkering around) 
what I ended up with was multiple bindings between exchange and queue :-)


I *think* that if I were to put my bindings in a link block, but keep 
the queue creation stuff in the node block that would have done what I'd 
expected, but TBH I've not actually tried that - I really should.


I think that in general it's good that the queue doesn't get recreated 
in the case you describe. In my scenario I'd like consumers to be able 
to create everything the first time that they connect, but if they then 
disconnect and reconnect I'd like any messages that have built up on the 
queue to remain.


Probably create:always is a bit misleading in this case, but I guess 
create: mostly probably sounds a bit weird :-D


I *think* that in the scenario that you illustrate above if you add 
autodelete:True then the queue will get deleted after the last 
connection closes and then recreated on the first new connection after that.


Frase

-
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org



How to create an exclusive queue?

2013-12-06 Thread Marcelo Vieira
Is there a way to create a new and exclusive queue that accepts only one 
session at a time? I'm trying to use 'qpid-config' command for this, is 
there any parameter to do that?


I tried using the configuration x-declare: {auto-delete: false, 
exclusive: true} in the creation of the session, but it seems to have 
had no result


-
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org



Re: How to create an exclusive queue?

2013-12-06 Thread Gordon Sim

On 12/06/2013 03:43 PM, Marcelo Vieira wrote:

Is there a way to create a new and exclusive queue that accepts only one
session at a time? I'm trying to use 'qpid-config' command for this, is
there any parameter to do that?

I tried using the configuration x-declare: {auto-delete: false,
exclusive: true} in the creation of the session, but it seems to have
had no result


You can't really do it from qpid-config. However you can add that 
x-declare to the node properties of the addres you use to create the 
sender/receiver/publisher/consumer, e.g


  my-queue; {node:{x-declare: {auto-delete: false, exclusive: true}}}


-
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org



Re: How to create an exclusive queue?

2013-12-06 Thread Marcelo Vieira

Hi Gordon,

Thanks for reply. I tried to do that anyway, but it seems that did not 
work. I have a script that runs as a daemon and creates a session to 
read messagens from a queue. Even with x-declare, other scripts can 
create sessions to read messages from the same queue, and I need to 
avoid this.


Is there some additional configuration required on the server to do this?

On 06-12-2013 13:50, Gordon Sim wrote:

On 12/06/2013 03:43 PM, Marcelo Vieira wrote:

Is there a way to create a new and exclusive queue that accepts only one
session at a time? I'm trying to use 'qpid-config' command for this, is
there any parameter to do that?

I tried using the configuration x-declare: {auto-delete: false,
exclusive: true} in the creation of the session, but it seems to have
had no result


You can't really do it from qpid-config. However you can add that 
x-declare to the node properties of the addres you use to create the 
sender/receiver/publisher/consumer, e.g


  my-queue; {node:{x-declare: {auto-delete: false, exclusive: true}}}


-
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org



Re: How to create an exclusive queue?

2013-12-06 Thread Darryl L. Pierce
On Fri, Dec 06, 2013 at 06:15:52PM +, Gordon Sim wrote:
 So actually a better suggestion might be, e.g.:
 
 'my-queue; {create:always, link:{x-subscribe:{exclusive:True}}}'

QQ - does create:always recreate the queue each time, even if it already
exists?

-- 
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/



pgpFDLbrdqgwr.pgp
Description: PGP signature