You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by raj <ra...@yahoo.com> on 2012/06/21 18:23:02 UTC

BrokerFilter#removeConnection is not called when using PooledConnectionFactory

Hi,

I have a requirement to restrict the number of connection allowed to a user.
For this purpose, I implemented a Plugin which increment a connection count
whenever a connection is made. Before incrementing the connection count,
user's connection limit is checked.

I want to decrement the connection count when a client connection is closed
and I have intercepted the BrokerFilter#removeConnection() method. This
works fine when connection is created using
org.apache.activemq.ActiveMQConnectionFactory. If I use
PooledConnectionFactory, removeConnection method is not called.

Is this expected behaviour of PooledConnectionFactory or it is a bug. 

Thanks,

Raj

--
View this message in context: http://activemq.2283324.n4.nabble.com/BrokerFilter-removeConnection-is-not-called-when-using-PooledConnectionFactory-tp4653446.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: BrokerFilter#removeConnection is not called when using PooledConnectionFactory

Posted by Dejan Bosanac <de...@nighttale.net>.
This is how it's supposed to work as PooledConnectionFacotry pools
connections. You have idleTimeout property (default 30 sec) and
connection will be actually closed if inactive for that period of
time.

Regards
--
Dejan Bosanac
Senior Software Engineer | FuseSource Corp.
dejanb@fusesource.com | fusesource.com
skype: dejan.bosanac | twitter: @dejanb
blog: http://www.nighttale.net
ActiveMQ in Action: http://www.manning.com/snyder/


On Thu, Jun 21, 2012 at 6:23 PM, raj <ra...@yahoo.com> wrote:
> Hi,
>
> I have a requirement to restrict the number of connection allowed to a user.
> For this purpose, I implemented a Plugin which increment a connection count
> whenever a connection is made. Before incrementing the connection count,
> user's connection limit is checked.
>
> I want to decrement the connection count when a client connection is closed
> and I have intercepted the BrokerFilter#removeConnection() method. This
> works fine when connection is created using
> org.apache.activemq.ActiveMQConnectionFactory. If I use
> PooledConnectionFactory, removeConnection method is not called.
>
> Is this expected behaviour of PooledConnectionFactory or it is a bug.
>
> Thanks,
>
> Raj
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/BrokerFilter-removeConnection-is-not-called-when-using-PooledConnectionFactory-tp4653446.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.