This discussion is archived
5 Replies Latest reply: Feb 12, 2013 4:15 AM by user123799 RSS

Monitor Coherence *Extend clients

879423 Newbie
Currently Being Moderated
Hello,

Does anyone know if there's a way to monitor the clients that connect to *Extend proxy nodes? I was under the impression that all you had to do was

a) implement MemberListener and define the interface's methods
b) add a new XML <member-listener> element under the <proxy-scheme>

I've followed these steps but none of the listener methods ever get invoked. any ideas?

Thanks!
  • 1. Re: Monitor Coherence *Extend clients
    Jonathan.Knight Expert
    Currently Being Moderated
    Hi,

    As far as I know the member listener will get events when other members join or leave the service - i.e. other cluster members that are running the same proxy service start or stop. Clients do not join the service so will not trigger events.

    If you want to monitor clients you might be able to use the functionality in the security API - http://docs.oracle.com/cd/E24290_01/coh.371/e22841/toc.htm

    JK
  • 2. Re: Monitor Coherence *Extend clients
    879423 Newbie
    Currently Being Moderated
    Thanks Jonathan, doesn't look like there's an event based structure though around connect/disconnect events from a client (unless I've missed something obvious)
  • 3. Re: Monitor Coherence *Extend clients
    Jonathan.Knight Expert
    Currently Being Moderated
    Hi

    You can get connection events by adding a connection listener to the Proxy Service's acceptor. It is not part of the documented API so you are kind of on your own with it but it is something like this...
    com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.ProxyService proxy;
    Service service = CacheFactory.getService("...name of your proxy service in cache config...");
    if (service instanceof SafeService) {
        proxy = (ProxyService) ((SafeService)service).getService();
    } else {
        proxy = (ProxyService) service;
    }
    proxy.getAcceptor().addConnectionListener(listener);
    JK
  • 4. Re: Monitor Coherence *Extend clients
    879423 Newbie
    Currently Being Moderated
    Ah that's exactly what I was looking for. I found a PDF from 2009 saying you could use this API, but I couldn't figure out how to get to the ConnectionManager part of it. Thanks Jonathan!
  • 5. Re: Monitor Coherence *Extend clients
    user123799 Newbie
    Currently Being Moderated
    Hi Ioannis,

    In case this is also of use... you can also have extend clients attach a MemberListener. This node leavign / left methods will be called back if the TCP connection is lost.

    By default passive extend clients, i.e. those that are event driven, tend to take a long time to detect a connection has been lost. This is because TCP timeouts are around the 5 minute mark, depending on OS. If you want to detect failure quicker its worth either tweaking the OS level keep-alives or configuring client (and server) heartbeats on the proxies.

    E.g.

    Client side:

    <pre>
    <caching-schemes>
    <remote-cache-scheme>
    <scheme-name>blah</scheme-name>
    <service-name>blah</service-name>
    <initiator-config>
    <tcp-initiator>
    ...
    </tcp-initiator>
    <outgoing-message-handler>
    <heartbeat-interval>5s</heartbeat-interval>
    <heartbeat-timeout>5s</heartbeat-timeout>
    ...
    </outgoing-message-handler>
    </initiator-config>
    </remote-cache-scheme>
    </caching-schemes>
    </pre>

    Server side:
    <pre>
    <proxy-scheme>
    <scheme-name>blah</scheme-name>
    <service-name>blah</service-name>
    ...
    <acceptor-config>
    <tcp-acceptor>
    ...
    </tcp-acceptor>
    <outgoing-message-handler>
    <heartbeat-interval>5s</heartbeat-interval>
    <heartbeat-timeout>4s</heartbeat-timeout>
    </outgoing-message-handler>
    ...
    </acceptor-config>
    ...
    </proxy-scheme>
    </pre>

    Hope this helps,

    Andy

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points