You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by manua <ag...@gmail.com> on 2011/08/22 18:26:02 UTC
Subscriber on a secure topic goes in unack infinite loop
HI,
I have defined a secure topic in the activemq.xml, where only admin can
write and user can only read.
If the topic exists and subscriber is subscribed it works fine.
But if the topic is not there and subscriber tries to subscribe it gets the
message that user doesn't have the permissions to create the topic(as
expected), but after that subscriber sends a Ack and stuck in infinite loop
with the message unexpected ACK received.
Please find below my code snippet for the subscriber,
my $broker = defined($ARGV[0])? $ARGV[0] : "manu.rsi.com";
my $stmp = Net::Stomp->new( { hostname => $broker, port => 61612} );
$stmp->connect( { login => 'user', passcode => 'password' });
my $destination = "/topic/Test.T";
$stmp->subscribe(
{
destination => $destination,
'ack' => 'client',
'activemq.prefetchSize' => 1000,
}
);
while(1){
my $frm = $stmp->receive_frame({ timeout => 300 });
$stmp->ack( { frame => $frm } );
print Dumper $frm;
}
Is this the expected behavior in case of secure topics or am I doing
something wrong.
Thanks
Manu
--
View this message in context: http://activemq.2283324.n4.nabble.com/Subscriber-on-a-secure-topic-goes-in-unack-infinite-loop-tp3760584p3760584.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Subscriber on a secure topic goes in unack infinite loop
Posted by manua <ag...@gmail.com>.
Thanks Tim, will try to code for that.
Thanks
Manu
--
View this message in context: http://activemq.2283324.n4.nabble.com/Subscriber-on-a-secure-topic-goes-in-unack-infinite-loop-tp3760584p3761108.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Subscriber on a secure topic goes in unack infinite loop
Posted by Timothy Bish <ta...@gmail.com>.
On Mon, 2011-08-22 at 09:26 -0700, manua wrote:
> HI,
>
> I have defined a secure topic in the activemq.xml, where only admin can
> write and user can only read.
>
> If the topic exists and subscriber is subscribed it works fine.
> But if the topic is not there and subscriber tries to subscribe it gets the
> message that user doesn't have the permissions to create the topic(as
> expected), but after that subscriber sends a Ack and stuck in infinite loop
> with the message unexpected ACK received.
The Frame you are getting back should be the ERROR frame. Your code
needs to check for that as you don't ack an ERROR frame, you must come
up with some logic to deal with the situation.
Regards
>
> Please find below my code snippet for the subscriber,
>
> my $broker = defined($ARGV[0])? $ARGV[0] : "manu.rsi.com";
> my $stmp = Net::Stomp->new( { hostname => $broker, port => 61612} );
> $stmp->connect( { login => 'user', passcode => 'password' });
>
> my $destination = "/topic/Test.T";
>
> $stmp->subscribe(
> {
> destination => $destination,
> 'ack' => 'client',
> 'activemq.prefetchSize' => 1000,
> }
> );
>
> while(1){
> my $frm = $stmp->receive_frame({ timeout => 300 });
> $stmp->ack( { frame => $frm } );
> print Dumper $frm;
> }
>
> Is this the expected behavior in case of secure topics or am I doing
> something wrong.
>
> Thanks
> Manu
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Subscriber-on-a-secure-topic-goes-in-unack-infinite-loop-tp3760584p3760584.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
--
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/