monitoring connection events - connection and disconnection

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

monitoring connection events - connection and disconnection

Jędrzej Dudkiewicz
Hello,

I've seen some questions regarding connection state monitoring, but
they all (from what I've seen) are based on advisory topic. My
question is:

if I wrote a plugin that would be executed for all connections, would
it be able to hijack each and every connection event and send
information regarding this fact to some queue that I'll select? I'm
asking not whether there is interface for it (there is), but whether
there is a chance that I would miss some events - most probably this
will be during broker startup or shutdown, so I'm most interested in
this area. I wrote test plugin and it seems to work, but maybe there
is a chance that I will enter a state where I won't be able to send to
queue (as this part of broker will be not ready yet or will be already
closed).

Note that I'm not interested in any same-jvm connections or internal
amq connections, only external (TLS) connections.

Any pitfalls that you know of?

Thanks in advance,
--
Jędrzej Dudkiewicz

I really hate this damn machine, I wish that they would sell it.
It never does just what I want, but only what I tell it.
Reply | Threaded
Open this post in threaded view
|

Re: monitoring connection events - connection and disconnection

Łukasz Dywicki
Hej Jakub,
This is entirely possible if you start your implementation as a regular BrokerPlugin (talking here about AMQ 5.x APIs).
I’ve seen such implementations and even participated in one and they did work nicely. What is tricky is eventual loop detection of internal connections, even one which forwards advisory somewhere else, which you will most likely see.
You can use AdvisoryBroker as a starting point and change it to something what you need.

Your sincerely,
Łukasz Dywicki


> On 21 Jan 2020, at 17:36, Jędrzej Dudkiewicz <[hidden email]> wrote:
>
> Hello,
>
> I've seen some questions regarding connection state monitoring, but
> they all (from what I've seen) are based on advisory topic. My
> question is:
>
> if I wrote a plugin that would be executed for all connections, would
> it be able to hijack each and every connection event and send
> information regarding this fact to some queue that I'll select? I'm
> asking not whether there is interface for it (there is), but whether
> there is a chance that I would miss some events - most probably this
> will be during broker startup or shutdown, so I'm most interested in
> this area. I wrote test plugin and it seems to work, but maybe there
> is a chance that I will enter a state where I won't be able to send to
> queue (as this part of broker will be not ready yet or will be already
> closed).
>
> Note that I'm not interested in any same-jvm connections or internal
> amq connections, only external (TLS) connections.
>
> Any pitfalls that you know of?
>
> Thanks in advance,
> --
> Jędrzej Dudkiewicz
>
> I really hate this damn machine, I wish that they would sell it.
> It never does just what I want, but only what I tell it.

Reply | Threaded
Open this post in threaded view
|

Re: monitoring connection events - connection and disconnection

Jędrzej Dudkiewicz
On Tue, Jan 21, 2020 at 11:31 PM <[hidden email]> wrote:
>
> Hej Jakub,
> This is entirely possible if you start your implementation as a regular BrokerPlugin (talking here about AMQ 5.x APIs).

This is what I did, so I seem to be find on this end.

> I’ve seen such implementations and even participated in one and they did work nicely. What is tricky is eventual loop detection of internal connections, even one which forwards advisory somewhere else, which you will most likely see.

This shouldn't be a problem, I already have a plugin that manages TLS
connections (checks for proper certificate), it should be easy to
extend it to provide this additional functionality. What I wanted to
know was if the basic idea is sound. If it is then there won't be any
problems I think.

Thanks for an answer!

JD

> You can use AdvisoryBroker as a starting point and change it to something what you need.

> Your sincerely,
> Łukasz Dywicki
>
>
> > On 21 Jan 2020, at 17:36, Jędrzej Dudkiewicz <[hidden email]> wrote:
> >
> > Hello,
> >
> > I've seen some questions regarding connection state monitoring, but
> > they all (from what I've seen) are based on advisory topic. My
> > question is:
> >
> > if I wrote a plugin that would be executed for all connections, would
> > it be able to hijack each and every connection event and send
> > information regarding this fact to some queue that I'll select? I'm
> > asking not whether there is interface for it (there is), but whether
> > there is a chance that I would miss some events - most probably this
> > will be during broker startup or shutdown, so I'm most interested in
> > this area. I wrote test plugin and it seems to work, but maybe there
> > is a chance that I will enter a state where I won't be able to send to
> > queue (as this part of broker will be not ready yet or will be already
> > closed).
> >
> > Note that I'm not interested in any same-jvm connections or internal
> > amq connections, only external (TLS) connections.
> >
> > Any pitfalls that you know of?
> >
> > Thanks in advance,
> > --
> > Jędrzej Dudkiewicz
> >
> > I really hate this damn machine, I wish that they would sell it.
> > It never does just what I want, but only what I tell it.
>


--
Jędrzej Dudkiewicz

I really hate this damn machine, I wish that they would sell it.
It never does just what I want, but only what I tell it.