3 Replies Latest reply: Dec 18, 2013 4:29 AM by user123799 RSS

Proxy Failure Detection using Member Listener

82420128-c6b8-49b4-9804-510cbc337b09 Newbie
Currently Being Moderated

Hi Guys,

 

I have registered a MemberListener on my Java *Extend client to detect a Proxy Failures and re-connect immediately, which is working fine. However, when *Extend client attempts to re-connect it tires to connect to the Proxy which just died, then it realizes it cannot make an connection and then tries to connect to another proxy in the list. I would like to optimize this buy removing the proxy which just died from the list of available proxies, but the thing is in the 'memberLeft' event, I don't get the details of the proxy which just died. Am i missing something here?

 

Here is code snippet

{code}

 

SafeCacheService cacheService = (SafeCacheService)CacheFactory.getService("ExtendTcpProxyService");

  cacheService.addMemberListener(new MemberListener() {

   @Override
   public void memberLeft(MemberEvent arg0) {
    System.out.println("memeber left. MachineName = " + arg0.getMember().getMachineName() + ",  memberName=" + arg0.getMember().getMemberName() + ", memberId= " + arg0.getMember().getId() + ", Port= " + arg0.getMember().getPort() );
   }

   @Override
   public void memberLeaving(MemberEvent arg0) {
    System.out.println("memebr leaving ");    
   }

   @Override
   public void memberJoined(MemberEvent arg0) {
    System.out.println("memebr Joined ");

   }
  });

{code}

 

Output:

 

2013-11-04 21:39:38.089/29.472 Oracle Coherence GE 3.7.1.6 <D6> (thread=ExtendTcpProxyService:TcpInitiator, member=n/a): Closed: Channel(Id=178849014, Open=false)memebr leaving
2013-11-04 21:39:38.089/29.472 Oracle Coherence GE 3.7.1.6 <D6> (thread=ExtendTcpProxyService:TcpInitiator, member=n/a): Closed: Channel(Id=1758436466, Open=false)
2013-11-04 21:39:38.089/29.472 Oracle Coherence GE 3.7.1.6 <D6> (thread=ExtendTcpProxyService:TcpInitiator, member=n/a): Closed: TcpConnection(Id=0x00000142250CBE14233B2E263B31CBF09BCAFC19E87958B1C7A86F7E7A6F59AD, Open=false, Member(Id=0, Timestamp=2013-11-04 21:39:10.554, Address=35.134.120.1:0, MachineId=0, Location=site:,machine:buxtonldnrs1,process:5772, Role=BarclaysTestExtendClient), LocalAddress=0.0.0.0:3734, RemoteAddress=35.59.46.38:9098) due to:
com.tangosol.net.messaging.ConnectionException: TcpConnection(Id=0x00000142250CBE14233B2E263B31CBF09BCAFC19E87958B1C7A86F7E7A6F59AD, Open=true, Member(Id=0, Timestamp=2013-11-04 21:39:10.554, Address=35.134.120.1:0, MachineId=0, Location=site:,machine:buxtonldnrs1,process:5772, Role=BarclaysTestExtendClient), LocalAddress=0.0.0.0:3734, RemoteAddress=35.59.46.38:9098)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.peer.initiator.TcpInitiator$TcpConnection$TcpReader.onNotify(TcpInitiator.CDB:49)
at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:271)
at com.tangosol.util.ExternalizableHelper.readInt(ExternalizableHelper.java:539)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.peer.initiator.TcpInitiator$TcpConnection$TcpReader.onNotify(TcpInitiator.CDB:20)
at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
at java.lang.Thread.run(Thread.java:662)


memeber left.. MachineName = buxtonldnrs1,  memberName=null,  memberId=0, Port=0

 

Basically, I want to get the details of the proxy which just died, any ideas of how to get these details will be much appreciated.

 

 

Thanks

D


Legend

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