You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Bruce Snyder <br...@gmail.com> on 2008/09/02 20:09:49 UTC

Re: How to intercept the creation of ActiveMQConnections?

On Thu, Aug 21, 2008 at 9:19 AM, Bruce Snyder <br...@gmail.com> wrote:
> On Wed, Aug 20, 2008 at 11:03 AM, Bruce Snyder <br...@gmail.com> wrote:
>> On Wed, Aug 20, 2008 at 10:43 AM, James Strachan
>> <ja...@gmail.com> wrote:
>>> The broker doesn't know about a client side connection object until its started
>>
>> I guess that's because there's no knowledge of the broker until that
>> point. Is that correct? Hmmm :-(.
>>
>> It seems to me that we should be able to intercept the initial request
>> to create a connection instead of waiting for the client to call
>> start(). I'd like to add a call to BrokerFilter.addConnection()
>> earlier in the process. Is there any exposure of a Broker sooner than
>> the creation of a TransportConnection?
>>
>> Well even so, a call to ActiveMQConnection.start() does not call down
>> into the BrokerFilter.addConnection() method anywhere in the process.
>
> Any thoughts on my questions above?

Any additional thoughts here? I'm thinking of using AOP.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/

Blog: http://bruceblog.org/

Re: How to intercept the creation of ActiveMQConnections?

Posted by Rob Davies <ra...@gmail.com>.
We can add it there too if there is demand.
On 3 Sep 2008, at 19:50, Bruce Snyder wrote:

> On Wed, Sep 3, 2008 at 12:20 PM, Rob Davies <ra...@gmail.com>  
> wrote:
>> Tcp catches SSL too - not sure if anybody uses UDP - and limiting  
>> vm://
>> doesn't make sense (to me anyway) ?
>
> What about HTTP, NIO or XMPP?
>
> Bruce
> -- 
> perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\! 
> G;6%I;\"YC;VT*"
> );'
>
> Apache ActiveMQ - http://activemq.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
>
> Blog: http://bruceblog.org/


Re: How to intercept the creation of ActiveMQConnections?

Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Sep 3, 2008 at 12:20 PM, Rob Davies <ra...@gmail.com> wrote:
> Tcp catches SSL too - not sure if anybody uses UDP - and limiting vm://
> doesn't make sense (to me anyway) ?

What about HTTP, NIO or XMPP?

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/

Blog: http://bruceblog.org/

Re: How to intercept the creation of ActiveMQConnections?

Posted by Rob Davies <ra...@gmail.com>.
Tcp catches SSL too - not sure if anybody uses UDP - and limiting  
vm:// doesn't make sense (to me anyway) ?

On 3 Sep 2008, at 18:18, Bruce Snyder wrote:

> On Wed, Sep 3, 2008 at 11:15 AM, Rob Davies <ra...@gmail.com>  
> wrote:
>> Yep - going to add it to TcpTransportServer
>
> But adding it there would only limit TCP connections. My intent was to
> limit any transport connection, no matter what the protocol.
>
> Bruce
> -- 
> perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\! 
> G;6%I;\"YC;VT*"
> );'
>
> Apache ActiveMQ - http://activemq.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
>
> Blog: http://bruceblog.org/


Re: How to intercept the creation of ActiveMQConnections?

Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Sep 3, 2008 at 11:15 AM, Rob Davies <ra...@gmail.com> wrote:
> Yep - going to add it to TcpTransportServer

But adding it there would only limit TCP connections. My intent was to
limit any transport connection, no matter what the protocol.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/

Blog: http://bruceblog.org/

Re: How to intercept the creation of ActiveMQConnections?

Posted by Rob Davies <ra...@gmail.com>.
Yep - going to add it to TcpTransportServer

On 3 Sep 2008, at 09:38, Gary Tully wrote:

> yea, intercept the accept listener for the TcpTransportConnector.
>
> This would be a nice feature to help throttle cpu usage by the broker.
> Imagine a hardware load balancer infront of a bunch of brokers,
> setting a max_concurrent_connections limit on the
> TcpTransportConnector would allow the loadbalancer to redistribute the
> connection attempt to another broker and each broker could be limited
> as appropriate.
> To maintain a count of active connections, it will be necessary to
> track connection close events also of course.
> Nearly seems like a job for a server socket factory.
>
>
> 2008/9/3 Hiram Chirino <hi...@hiramchirino.com>:
>> Then your going to have to stop/suspend the Accept thread for the
>> server socket or accept the connection but then shut it down.
>>
>> On Tue, Sep 2, 2008 at 5:55 PM, Bruce Snyder  
>> <br...@gmail.com> wrote:
>>> On Tue, Sep 2, 2008 at 3:37 PM, Hiram Chirino <hiram@hiramchirino.com 
>>> > wrote:
>>>> AOP won't help since the client is going to be in a different JVM  
>>>> the
>>>> server.  So there is no server logic that can control the client  
>>>> until
>>>> the client connects.. and it seems your too late at that point.
>>>
>>> I'm not looking to control connections from the client side. I  
>>> want to
>>> be able to limit the number of client connections from the broker
>>> side.
>>>
>>> Bruce
>>> --
>>> perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D 
>>> \!G;6%I;\"YC;VT*"
>>> );'
>>>
>>> Apache ActiveMQ - http://activemq.org/
>>> Apache Camel - http://activemq.org/camel/
>>> Apache ServiceMix - http://servicemix.org/
>>>
>>> Blog: http://bruceblog.org/
>>>
>>
>>
>>
>> --
>> Regards,
>> Hiram
>>
>> Blog: http://hiramchirino.com
>>
>> Open Source SOA
>> http://open.iona.com
>>


Re: How to intercept the creation of ActiveMQConnections?

Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Sep 3, 2008 at 2:38 AM, Gary Tully <ga...@gmail.com> wrote:
> yea, intercept the accept listener for the TcpTransportConnector.
>
> This would be a nice feature to help throttle cpu usage by the broker.
> Imagine a hardware load balancer infront of a bunch of brokers,
> setting a max_concurrent_connections limit on the
> TcpTransportConnector would allow the loadbalancer to redistribute the
> connection attempt to another broker and each broker could be limited
> as appropriate.

Correct, the idea is that this feature will offer multiple limiting
strategies, one of which will utilize the Usage objects to limit the
amount of resource usage. But I need to figure out how best to handle
a connection refusal so that the client will try again.

> To maintain a count of active connections, it will be necessary to
> track connection close events also of course.
> Nearly seems like a job for a server socket factory.

Right, this is why the BrokerFilter methods seemed so appropriate, but
it doesn't cover this type of connectivity.

> 2008/9/3 Hiram Chirino <hi...@hiramchirino.com>:
>> Then your going to have to stop/suspend the Accept thread for the
>> server socket or accept the connection but then shut it down.

Yeah, I already had looked there but assumed that there must be a
better way. I'll go back to that.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/

Blog: http://bruceblog.org/

Re: How to intercept the creation of ActiveMQConnections?

Posted by James Strachan <ja...@gmail.com>.
2008/9/3 Hiram Chirino <hi...@hiramchirino.com>:
> Most hardware load balancers will keep track of the active TCP
> sessions against a server so there really is no need to reject
> connections.  The will spread the load onto servers with the fewest
> active connections.  This is more of feature for when there is NO load
> balancer in play.

Agreed - its main value seems to be if using the ActiveMQ failover
protocol to randomly connect to a set of brokers; to limit the number
of connections on one specific broker.

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Re: How to intercept the creation of ActiveMQConnections?

Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Sep 3, 2008 at 10:54 AM, James Strachan
<ja...@gmail.com> wrote:
> 2008/9/3 Gary Tully <ga...@gmail.com>:
>>> Though number of connections in no way reflects the cpu usage of a
>>> broker;
>>>
>> what are you thinking here?
>
> You could have 1000 connections doing very little, waiting for
> messages - but another broker could have one connection sending 5000
> messages/second.
>
> A single connection can use up the entire CPU on a broker; so am not
> sure there's much merrit on associating connection count to cpu usage.
> Though having a maximum allowed connection count is fine though

Yes, and that was my original intent - associating connections a
static limit and with a percentage of the broker's memory usage. As
this discussion about CPU usage unfolded, I thought I must have
completely overlooked a thread in the connection or something.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/

Blog: http://bruceblog.org/

Re: How to intercept the creation of ActiveMQConnections?

Posted by James Strachan <ja...@gmail.com>.
2008/9/3 Gary Tully <ga...@gmail.com>:
>> Though number of connections in no way reflects the cpu usage of a
>> broker;
>>
> what are you thinking here?

You could have 1000 connections doing very little, waiting for
messages - but another broker could have one connection sending 5000
messages/second.

A single connection can use up the entire CPU on a broker; so am not
sure there's much merrit on associating connection count to cpu usage.
Though having a maximum allowed connection count is fine though

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Re: How to intercept the creation of ActiveMQConnections?

Posted by Hiram Chirino <hi...@hiramchirino.com>.
A better metric would be total msgs/sec that are being processed.

On Wed, Sep 3, 2008 at 12:46 PM, Gary Tully <ga...@gmail.com> wrote:
>> Though number of connections in no way reflects the cpu usage of a
>> broker;
>>
> what are you thinking here? I am thinking that typically there will be
> a direct correlation between cpu usage and number of connections. In
> particular a broker with no connections will use very little cpu, add
> a steady producer via a connection and things start to happen, another
> connection a consumer or producer and more utilisation will occur etc.
> Agreed a plugable strategy is best but on the 80/20 rule I am thinking
> raw number of connections is a reasonable metric. Consumers and
> producers may already be partitioned by the application. Am I missing
> something here?
>



-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Open Source SOA
http://open.iona.com

Re: How to intercept the creation of ActiveMQConnections?

Posted by Gary Tully <ga...@gmail.com>.
> Though number of connections in no way reflects the cpu usage of a
> broker;
>
what are you thinking here? I am thinking that typically there will be
a direct correlation between cpu usage and number of connections. In
particular a broker with no connections will use very little cpu, add
a steady producer via a connection and things start to happen, another
connection a consumer or producer and more utilisation will occur etc.
Agreed a plugable strategy is best but on the 80/20 rule I am thinking
raw number of connections is a reasonable metric. Consumers and
producers may already be partitioned by the application. Am I missing
something here?

Re: How to intercept the creation of ActiveMQConnections?

Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Sep 3, 2008 at 9:54 AM, James Strachan <ja...@gmail.com> wrote:
> 2008/9/3 Gary Tully <ga...@gmail.com>:
>> But if you only want AMQ to utilise say 40% of cpu resources (cause it
>> is not the only beast on the box), can I tell my hardware loadbalancer
>> that I only want say 40 connections per broker? If not, then the
>> ability to configure a limit on the number of connections and reject
>> those in excess would be handy.
>> Is there any other way to limit/throttle CPU utilisation with AMQ?
>
> Though number of connections in no way reflects the cpu usage of a
> broker; so I guess we have to rely on operating systems to do the
> right thing when it comes to playing nice etc. (Did you notice the
> little unix joke at the end of that sentence :)

Nice one, James ;-).

That's correct, but if I create this feature as a plugin to ActiveMQ,
then the number of connections can be limited based on CPU and/or
memory utilization as one of the strategies.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/

Blog: http://bruceblog.org/

Re: How to intercept the creation of ActiveMQConnections?

Posted by James Strachan <ja...@gmail.com>.
2008/9/3 Gary Tully <ga...@gmail.com>:
> But if you only want AMQ to utilise say 40% of cpu resources (cause it
> is not the only beast on the box), can I tell my hardware loadbalancer
> that I only want say 40 connections per broker? If not, then the
> ability to configure a limit on the number of connections and reject
> those in excess would be handy.
> Is there any other way to limit/throttle CPU utilisation with AMQ?

Though number of connections in no way reflects the cpu usage of a
broker; so I guess we have to rely on operating systems to do the
right thing when it comes to playing nice etc. (Did you notice the
little unix joke at the end of that sentence :)
-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Re: How to intercept the creation of ActiveMQConnections?

Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Sep 3, 2008 at 9:51 AM, Gary Tully <ga...@gmail.com> wrote:
> But if you only want AMQ to utilise say 40% of cpu resources (cause it
> is not the only beast on the box), can I tell my hardware loadbalancer
> that I only want say 40 connections per broker? If not, then the
> ability to configure a limit on the number of connections and reject
> those in excess would be handy.
> Is there any other way to limit/throttle CPU utilisation with AMQ?

That's exactly why I'm doing this. Currently, ActiveMQ will continue
to hand out connections until it dies if it's asked to do so and I'd
like to prevent this. Use of a load balancer is inconsequential to
this feature.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/

Blog: http://bruceblog.org/

Re: How to intercept the creation of ActiveMQConnections?

Posted by Gary Tully <ga...@gmail.com>.
But if you only want AMQ to utilise say 40% of cpu resources (cause it
is not the only beast on the box), can I tell my hardware loadbalancer
that I only want say 40 connections per broker? If not, then the
ability to configure a limit on the number of connections and reject
those in excess would be handy.
Is there any other way to limit/throttle CPU utilisation with AMQ?

2008/9/3 Hiram Chirino <hi...@hiramchirino.com>:
> Most hardware load balancers will keep track of the active TCP
> sessions against a server so there really is no need to reject
> connections.  The will spread the load onto servers with the fewest
> active connections.  This is more of feature for when there is NO load
> balancer in play.
>
> On Wed, Sep 3, 2008 at 4:38 AM, Gary Tully <ga...@gmail.com> wrote:
>> yea, intercept the accept listener for the TcpTransportConnector.
>>
>> This would be a nice feature to help throttle cpu usage by the broker.
>> Imagine a hardware load balancer infront of a bunch of brokers,
>> setting a max_concurrent_connections limit on the
>> TcpTransportConnector would allow the loadbalancer to redistribute the
>> connection attempt to another broker and each broker could be limited
>> as appropriate.
>> To maintain a count of active connections, it will be necessary to
>> track connection close events also of course.
>> Nearly seems like a job for a server socket factory.
>>
>>
>> 2008/9/3 Hiram Chirino <hi...@hiramchirino.com>:
>>> Then your going to have to stop/suspend the Accept thread for the
>>> server socket or accept the connection but then shut it down.
>>>
>>> On Tue, Sep 2, 2008 at 5:55 PM, Bruce Snyder <br...@gmail.com> wrote:
>>>> On Tue, Sep 2, 2008 at 3:37 PM, Hiram Chirino <hi...@hiramchirino.com> wrote:
>>>>> AOP won't help since the client is going to be in a different JVM the
>>>>> server.  So there is no server logic that can control the client until
>>>>> the client connects.. and it seems your too late at that point.
>>>>
>>>> I'm not looking to control connections from the client side. I want to
>>>> be able to limit the number of client connections from the broker
>>>> side.
>>>>
>>>> Bruce
>>>> --
>>>> perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>>>> );'
>>>>
>>>> Apache ActiveMQ - http://activemq.org/
>>>> Apache Camel - http://activemq.org/camel/
>>>> Apache ServiceMix - http://servicemix.org/
>>>>
>>>> Blog: http://bruceblog.org/
>>>>
>>>
>>>
>>>
>>> --
>>> Regards,
>>> Hiram
>>>
>>> Blog: http://hiramchirino.com
>>>
>>> Open Source SOA
>>> http://open.iona.com
>>>
>>
>
>
>
> --
> Regards,
> Hiram
>
> Blog: http://hiramchirino.com
>
> Open Source SOA
> http://open.iona.com
>

Re: How to intercept the creation of ActiveMQConnections?

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Most hardware load balancers will keep track of the active TCP
sessions against a server so there really is no need to reject
connections.  The will spread the load onto servers with the fewest
active connections.  This is more of feature for when there is NO load
balancer in play.

On Wed, Sep 3, 2008 at 4:38 AM, Gary Tully <ga...@gmail.com> wrote:
> yea, intercept the accept listener for the TcpTransportConnector.
>
> This would be a nice feature to help throttle cpu usage by the broker.
> Imagine a hardware load balancer infront of a bunch of brokers,
> setting a max_concurrent_connections limit on the
> TcpTransportConnector would allow the loadbalancer to redistribute the
> connection attempt to another broker and each broker could be limited
> as appropriate.
> To maintain a count of active connections, it will be necessary to
> track connection close events also of course.
> Nearly seems like a job for a server socket factory.
>
>
> 2008/9/3 Hiram Chirino <hi...@hiramchirino.com>:
>> Then your going to have to stop/suspend the Accept thread for the
>> server socket or accept the connection but then shut it down.
>>
>> On Tue, Sep 2, 2008 at 5:55 PM, Bruce Snyder <br...@gmail.com> wrote:
>>> On Tue, Sep 2, 2008 at 3:37 PM, Hiram Chirino <hi...@hiramchirino.com> wrote:
>>>> AOP won't help since the client is going to be in a different JVM the
>>>> server.  So there is no server logic that can control the client until
>>>> the client connects.. and it seems your too late at that point.
>>>
>>> I'm not looking to control connections from the client side. I want to
>>> be able to limit the number of client connections from the broker
>>> side.
>>>
>>> Bruce
>>> --
>>> perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>>> );'
>>>
>>> Apache ActiveMQ - http://activemq.org/
>>> Apache Camel - http://activemq.org/camel/
>>> Apache ServiceMix - http://servicemix.org/
>>>
>>> Blog: http://bruceblog.org/
>>>
>>
>>
>>
>> --
>> Regards,
>> Hiram
>>
>> Blog: http://hiramchirino.com
>>
>> Open Source SOA
>> http://open.iona.com
>>
>



-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Open Source SOA
http://open.iona.com

Re: How to intercept the creation of ActiveMQConnections?

Posted by Gary Tully <ga...@gmail.com>.
yea, intercept the accept listener for the TcpTransportConnector.

This would be a nice feature to help throttle cpu usage by the broker.
Imagine a hardware load balancer infront of a bunch of brokers,
setting a max_concurrent_connections limit on the
TcpTransportConnector would allow the loadbalancer to redistribute the
connection attempt to another broker and each broker could be limited
as appropriate.
To maintain a count of active connections, it will be necessary to
track connection close events also of course.
Nearly seems like a job for a server socket factory.


2008/9/3 Hiram Chirino <hi...@hiramchirino.com>:
> Then your going to have to stop/suspend the Accept thread for the
> server socket or accept the connection but then shut it down.
>
> On Tue, Sep 2, 2008 at 5:55 PM, Bruce Snyder <br...@gmail.com> wrote:
>> On Tue, Sep 2, 2008 at 3:37 PM, Hiram Chirino <hi...@hiramchirino.com> wrote:
>>> AOP won't help since the client is going to be in a different JVM the
>>> server.  So there is no server logic that can control the client until
>>> the client connects.. and it seems your too late at that point.
>>
>> I'm not looking to control connections from the client side. I want to
>> be able to limit the number of client connections from the broker
>> side.
>>
>> Bruce
>> --
>> perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>> );'
>>
>> Apache ActiveMQ - http://activemq.org/
>> Apache Camel - http://activemq.org/camel/
>> Apache ServiceMix - http://servicemix.org/
>>
>> Blog: http://bruceblog.org/
>>
>
>
>
> --
> Regards,
> Hiram
>
> Blog: http://hiramchirino.com
>
> Open Source SOA
> http://open.iona.com
>

Re: How to intercept the creation of ActiveMQConnections?

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Then your going to have to stop/suspend the Accept thread for the
server socket or accept the connection but then shut it down.

On Tue, Sep 2, 2008 at 5:55 PM, Bruce Snyder <br...@gmail.com> wrote:
> On Tue, Sep 2, 2008 at 3:37 PM, Hiram Chirino <hi...@hiramchirino.com> wrote:
>> AOP won't help since the client is going to be in a different JVM the
>> server.  So there is no server logic that can control the client until
>> the client connects.. and it seems your too late at that point.
>
> I'm not looking to control connections from the client side. I want to
> be able to limit the number of client connections from the broker
> side.
>
> Bruce
> --
> perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
>
> Apache ActiveMQ - http://activemq.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
>
> Blog: http://bruceblog.org/
>



-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Open Source SOA
http://open.iona.com

Re: How to intercept the creation of ActiveMQConnections?

Posted by Bruce Snyder <br...@gmail.com>.
On Tue, Sep 2, 2008 at 3:37 PM, Hiram Chirino <hi...@hiramchirino.com> wrote:
> AOP won't help since the client is going to be in a different JVM the
> server.  So there is no server logic that can control the client until
> the client connects.. and it seems your too late at that point.

I'm not looking to control connections from the client side. I want to
be able to limit the number of client connections from the broker
side.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/

Blog: http://bruceblog.org/

Re: How to intercept the creation of ActiveMQConnections?

Posted by Hiram Chirino <hi...@hiramchirino.com>.
AOP won't help since the client is going to be in a different JVM the
server.  So there is no server logic that can control the client until
the client connects.. and it seems your too late at that point.

On Tue, Sep 2, 2008 at 2:09 PM, Bruce Snyder <br...@gmail.com> wrote:
> On Thu, Aug 21, 2008 at 9:19 AM, Bruce Snyder <br...@gmail.com> wrote:
>> On Wed, Aug 20, 2008 at 11:03 AM, Bruce Snyder <br...@gmail.com> wrote:
>>> On Wed, Aug 20, 2008 at 10:43 AM, James Strachan
>>> <ja...@gmail.com> wrote:
>>>> The broker doesn't know about a client side connection object until its started
>>>
>>> I guess that's because there's no knowledge of the broker until that
>>> point. Is that correct? Hmmm :-(.
>>>
>>> It seems to me that we should be able to intercept the initial request
>>> to create a connection instead of waiting for the client to call
>>> start(). I'd like to add a call to BrokerFilter.addConnection()
>>> earlier in the process. Is there any exposure of a Broker sooner than
>>> the creation of a TransportConnection?
>>>
>>> Well even so, a call to ActiveMQConnection.start() does not call down
>>> into the BrokerFilter.addConnection() method anywhere in the process.
>>
>> Any thoughts on my questions above?
>
> Any additional thoughts here? I'm thinking of using AOP.
>
> Bruce
> --
> perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
>
> Apache ActiveMQ - http://activemq.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
>
> Blog: http://bruceblog.org/
>



-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Open Source SOA
http://open.iona.com