Binary decoration in Extend client

Is it possible to somehow intercept a simple put() operation at the client and to decorate the Binary objects produced by POF serialization? The goal here is to pass metadata that is not a part of the cached state and yet is available to be processed by e.g. MapTrigger or BinaryEntryStore implementations.

spark wrote:
Is it possible to somehow intercept a simple put() operation at the client and to decorate the Binary objects produced by POF serialization? The goal here is to pass metadata that is not a part of the cached state and yet is available to be processed by e.g. MapTrigger or BinaryEntryStore implementations.Hi spark,
I don't remember off my head the format of the decorated binary, if it is possible to write a decoration without knowing the size of the binary you want to decorate. If that is possible, then it would be possible with a custom Serializer (not PofSerializer) writing the decoration header before delegating to the original Serializer.
If you use POF and 3.6+ and you want to "decorate" only the value, you should probably write decoration data into the normal PofWriter and create a nested POF writer to write the to-be-decorated object afterwards.
Best regards,
Robert

Similar Messages

  • Handling of IdentityAsserter's SecurityException on extend client

    Coherence 3.7.1.7
    I have a custom implementation of com.tangosol.net.security.IdentityAsserter for authorization of extend clients.
    It looks something like this:
        public Subject assertIdentity(Object credentials, Service service) throws SecurityException {
            if (!userNameValid(credentials) {
                throw new SecurityException("Username is not valid");
            if (!passwordValid(credentials) {
                throw new SecurityException("Password is not valid");
           return subject;
    If I throw any SecurityException with any error message in IndenityAsserter I get the same error on extend client:
    2014-10-17 18:27:41.655/29.828 Oracle Coherence GE 3.7.1.7 <D5>: Connecting Socket to 10.75.82.176:8200
    2014-10-17 18:27:41.702/29.875 Oracle Coherence GE 3.7.1.7 <Info>: Connected Socket to 10.75.82.176:8200
    2014-10-17 18:27:45.108/33.281 Oracle Coherence GE 3.7.1.7 <D5>: Redirecting Socket to 10.75.82.182:8201
    2014-10-17 18:27:45.155/33.328 Oracle Coherence GE 3.7.1.7 <Info>: Connected Socket to 10.75.82.182:8201
    2014-10-17 18:27:46.217/34.390 Oracle Coherence GE 3.7.1.7 <Info>: Error establishing a connection with 10.75.82.182:8201: com.tangosol.net.messaging.ConnectionException: connection rejected
    2014-10-17 18:27:47.389/35.562 Oracle Coherence GE 3.7.1.7 <D5>: Redirecting Socket to 10.75.82.158:8201
    2014-10-17 18:27:47.436/35.609 Oracle Coherence GE 3.7.1.7 <Info>: Connected Socket to 10.75.82.158:8201
    2014-10-17 18:27:48.499/36.672 Oracle Coherence GE 3.7.1.7 <Info>: Error establishing a connection with 10.75.82.158:8201: com.tangosol.net.messaging.ConnectionException: connection rejected
    2014-10-17 18:27:48.499/36.672 Oracle Coherence GE 3.7.1.7 <D5>: Redirecting Socket to 10.75.82.176:8200
    2014-10-17 18:27:48.545/36.718 Oracle Coherence GE 3.7.1.7 <Info>: Connected Socket to 10.75.82.176:8200
    2014-10-17 18:27:49.639/37.812 Oracle Coherence GE 3.7.1.7 <Info>: Error establishing a connection with 10.75.82.176:8200: com.tangosol.net.messaging.ConnectionException: connection rejected
    2014-10-17 18:27:49.639/37.812 Oracle Coherence GE 3.7.1.7 <Error>: Error while starting service "ExtendTcpService": com.tangosol.net.messaging.ConnectionException: could not establish a connection to one of the following addresses: [10.75.82.176:8200, 10.75.82.182:8201, 10.75.82.138:8200, 10.75.82.158:8201, 10.75.82.176:8200]; make sure the "remote-addresses" configuration element contains an address and port of a running TcpAcceptor
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.peer.initiator.TcpInitiator.openConnection(TcpInitiator.CDB:120)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.peer.Initiator.ensureConnection(Initiator.CDB:11)
      at com.tangosol.coherence.component.net.extend.remoteService.RemoteCacheService.openChannel(RemoteCacheService.CDB:5)
      at com.tangosol.coherence.component.net.extend.RemoteService.doStart(RemoteService.CDB:11)
      at com.tangosol.coherence.component.net.extend.RemoteService.start(RemoteService.CDB:5)
      at com.tangosol.coherence.component.util.SafeService.startService(SafeService.CDB:39)
      at com.tangosol.coherence.component.util.safeService.SafeCacheService.startService(SafeCacheService.CDB:5)
      at com.tangosol.coherence.component.util.SafeService.ensureRunningService(SafeService.CDB:27)
      at com.tangosol.coherence.component.util.SafeService.start(SafeService.CDB:14)
      at com.tangosol.net.DefaultConfigurableCacheFactory.ensureServiceInternal(DefaultConfigurableCacheFactory.java:1105)
      at com.tangosol.net.DefaultConfigurableCacheFactory.ensureService(DefaultConfigurableCacheFactory.java:937)
      at com.tangosol.net.DefaultConfigurableCacheFactory.ensureCache(DefaultConfigurableCacheFactory.java:919)
      at com.tangosol.net.DefaultConfigurableCacheFactory.configureCache(DefaultConfigurableCacheFactory.java:1296)
      at com.tangosol.net.DefaultConfigurableCacheFactory.ensureCache(DefaultConfigurableCacheFactory.java:297)
      at com.tangosol.net.CacheFactory.getCache(CacheFactory.java:204)
      at com.tangosol.net.CacheFactory.getCache(CacheFactory.java:181)
    It's impossible to determine the real reason why connection was rejected from this exception. Is it because username was incorrect? Or password? Or any other credentials? Or maybe coherence cluster is indeed down? I would like to handle each of such situations differently.
    My question: is it possible to intercept and handle exceptions thrown in IdentityAsserter on client side?

    Hi<br><br>
              <p>
              I'm using version 9.2.0.0 with the following patches:
              <ul>
              <li>CR286749</li>
              <li>CR277158</li>
              <li>CR307754</li>
              <li>CR295248</li>
              <li>CR304536</li>
              </ul>
              </p>
              <p>
              It is possible to grant access to the user to the jndi node (e.g. weblogic.jms.connection), so he will be able to perform this operation over whole subtree, but this is not very neat and, what is more important, he will have access to the jndi objects, that he shold not.
              </p>
              <p>
              In fact I have decided to grant this user full access to the jndi tree, but gave limited access at the JMS level and no access to other resources (like EJB, JDBC, etc). This seems to work well.
              </p>
              regards<br>
              <br>Lukas<br>
              <br>WLS 9.2

  • Java extend client outside coherence grid or Java client inside grid ?

    Hello,
    I'm quite new with Coherence and I'm wondering the best option to connect a JAVA client that will communicate with coherence cluster during few seconds.
    Around 30 clients may connect at the same time.
    Cluster stores around 4Gb of data.
    I consider 2 options:
    1) make the JAVA client as a member of the grid. Some partitions will be transfered to it.
    2) have a proxy node in the grid and make JAVA client as an extend client.
    What'd be the pros and cons of these 2 options ?, shoud I consider other options ?
    Thank you for your advices, David

    If your Java client is only going to live for a few seconds then make it an Extend client not a cluster member. Short lived processes should not be cluster members as the continualy join/leave cycle will destablise the rest of the cluster.
    If your client was going to be long lived then you could make it a storage disabled cluster member.
    JK

  • Set user defined UUID for coherence extend clients

    I notice in Coherence 3.5.2 there are improved jmx stats for tcp extend clients.
    Right now I see a client is identified in jmx with a cryptic UUID. Is it possible for the tcp extend client to set its own UUID or alike, so one can more easily identify a client.

    Currently, Coherence does not support connection naming.

  • PushReplication retries cause local extend clients to be blocked!

    I have an issue where Push Replication retries cause local extend clients to be blocked!
    Scenario as follows:
    1) I start up my London cluster, and add around 130 push replication publishers (i.e. one per cache, per remote site)
    2) I set these publishers with auto start equal to true, and infinite retries in the case of failure. (i.e. i want my system to be totally automated, don't want an end user to go in to jmx and have to click resume across all 130 publishers).
    3) If my remote sites are up and available, the RemoteInvocationPublisher's alll connect, and all is fine.
    4) If however the remote sites are not available I see the push replication publishers retry periodically. The problem is any extend clients connecting into London get blocked by the 130 push rep publishing service threads that are retrying, and eventually timeout (stack trace below)
    ==========================================================================
    Name: Proxy:ExtendedTcpProxyService:TcpAcceptorWorker:17
    State: BLOCKED on com.tangosol.coherence.component.util.SafeCluster@18cad92 owned by: PublishingService:Thread-5
    Total blocked: 10 Total waited: 122
    Stack trace:
    com.tangosol.net.CacheFactory.ensureCluster(CacheFactory.java:995)
    com.tangosol.net.DefaultConfigurableCacheFactory.ensureService(DefaultConfigurableCacheFactory.java:915)
    com.oracle.coherence.environment.extensible.ExtensibleEnvironment.ensureService(ExtensibleEnvironment.java:374)
    com.tangosol.net.DefaultConfigurableCacheFactory.ensureCache(DefaultConfigurableCacheFactory.java:877)
    com.tangosol.net.DefaultConfigurableCacheFactory.configureCache(DefaultConfigurableCacheFactory.java:1088)
    com.tangosol.net.DefaultConfigurableCacheFactory.ensureCache(DefaultConfigurableCacheFactory.java:304)
    com.tangosol.coherence.component.net.extend.proxy.CacheServiceProxy.ensureNamedCacheProxy(CacheServiceProxy.CDB:27)
    - locked java.util.HashMap@18060fd
    com.tangosol.coherence.component.net.extend.messageFactory.CacheServiceFactory$EnsureCacheRequest.onRun(CacheServiceFactory.CDB:13)
    com.tangosol.coherence.component.net.extend.message.Request.run(Request.CDB:4)
    com.tangosol.coherence.component.net.extend.proxy.CacheServiceProxy.onMessage(CacheServiceProxy.CDB:1)
    com.tangosol.coherence.component.net.extend.Channel.execute(Channel.CDB:28)
    com.tangosol.coherence.component.net.extend.Channel.receive(Channel.CDB:26)
    com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer$DaemonPool$WrapperTask.run(Peer.CDB:9)
    com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:32)
    com.tangosol.coherence.component.util.DaemonPool$Daemon.onNotify(DaemonPool.CDB:63)
    com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
    java.lang.Thread.run(Thread.java:619)
    ==========================================================================
    It's a massive issue if a remote failure causes local clients to block!!!!
    Even if I set my retry count to not be infinite, and set my retry interval higher, it would seem there will still be a period where extend clients will be blocked by the publishing service thread retries!
    Any help much appreciated.
    Cheers,
    Neville.
    NB: Coherence version 3.5.3-p3 Incubator version used: (push rep 2.6.1.14471, messaging 2.6.1.14471, common 1.6.1.14470)

    Hi Neville,
    Sorry you're experiencing these challenges.
    Can you let me know;
    1. How many proxies you have available for each site?
    2. The number of threads configured per-proxy?
    3. The number of caches?
    4. The amount of data in those caches?
    5. The configuration files for each site.
    6. The deployment architecture, including the number of JVMs in each site cluster.
    It seems you're running out of resources on the extend proxies, so you'll probably need to configure more.
    -- Brian
    PS: If this information is sensitive, please feel free to email me directly to help resolve the issue. We can then arrange help and an on-site visit if needed.

  • TCP* Extend client thread pool

    Hi,
    Is there a way to configure the number of threads used by TCP* Extend client? What is the default value for the same?
    For some reason I am observing TCP connection being reset. Here are the logs:
    2010-05-05 04:39:02.572/15821.6> (thread=DistributedCacheForHDElements-NY:TcpInitiator, member=n/a): Closed: TcpConnection(Id=0x0000012866AD9AC4AAF0E60D08143308BF16B5D3C3356683C13C90CC0213FB3C, Open=false, LocalAddress=170.240.228.192:1105, RemoteAddress=170.240.230.13:27001)
    2010-05-05 04:39:02.572/15821.5> (thread=DistributedCacheForHDElements-NY:TcpInitiator, member=n/a): Stopped: TcpInitiator{Name=DistributedCacheForHDElements-NY:TcpInitiator, State=(SERVICE_STOPPED), ThreadCount=0, Codec=Codec(Format=POF), PingInterval=0, PingTimeout=10000, RequestTimeout=10000, ConnectTimeout=10000, RemoteAddresses=[/170.240.230.13:27001,/141.128.62.137:27007,/141.128.62.138:27005,/170.240.230.13:27002,/141.128.62.138:27006,/141.128.62.137:27008,/170.240.230.13:27003,/141.128.62.138:27004], KeepAliveEnabled=true, TcpDelayEnabled=false, ReceiveBufferSize=0, SendBufferSize=0, LingerTimeout=-1}
    2010-05-05 04:39:02.588/15821.5> (thread=DistributedCacheForHDElements-NY:TcpInitiator, member=n/a): Started: TcpInitiator{Name=DistributedCacheForHDElements-NY:TcpInitiator, State=(SERVICE_STARTED), ThreadCount=0, Codec=Codec(Format=POF), PingInterval=0, PingTimeout=10000, RequestTimeout=10000, ConnectTimeout=10000, RemoteAddresses=[/141.128.62.138:27006,/141.128.62.138:27005,/170.240.230.13:27003,/141.128.62.138:27004,/170.240.230.13:27002,/141.128.62.137:27007,/141.128.62.137:27008,/170.240.230.13:27001], KeepAliveEnabled=true, TcpDelayEnabled=false, ReceiveBufferSize=0, SendBufferSize=0, LingerTimeout=-1}
    2010-05-05 04:39:02.588/15821.5> (thread=[ACTIVE] ExecuteThread: '10' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Opening Socket connection to 141.128.62.138:27006
    2010-05-05 04:39:02.588/15821.nfo> (thread=[ACTIVE] ExecuteThread: '10' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Connected to 141.128.62.138:27006
    2010-05-05 04:39:02.604/15821.6> (thread=DistributedCacheForHDElements-NY:TcpInitiator, member=n/a): Opened: TcpConnection(Id=0x00000128679E39D68D803E8A52F48499974C7DC9B4BF127ECF23CF2771B8CB90, Open=true, LocalAddress=170.240.228.192:4742, RemoteAddress=141.128.62.138:27006)
    2010-05-05 04:39:02.604/15821.6> (thread=DistributedCacheForHDElements-NY:TcpInitiator, member=n/a): Opened: Channel(Id=1628408480, Open=true, Connection=0x00000128679E39D68D803E8A52F48499974C7DC9B4BF127ECF23CF2771B8CB90)
    2010-05-05 04:39:02.619/15821.6> (thread=DistributedCacheForHDElements-NY:TcpInitiator, member=n/a): Opened: Channel(Id=734361514, Open=true, Connection=0x00000128679E39D68D803E8A52F48499974C7DC9B4BF127ECF23CF2771B8CB90)
    Regards,
    Kishore
    Edited by: user10737736 on May 6, 2010 5:06 AM

    Hi Kishore,
    In the proxy-scheme of your cache configuration, you can use thread-count to configure the number of threads used by TCP* Extend client. The default value is 0. e.g.
    <proxy-scheme>
    <service-name>ExtendTcpProxyService</service-name>
    <thread-count>50</thread-count>
    </proxy-scheme>
    -Luk

  • Monitor Coherence *Extend clients

    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!

    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

  • WorkManager with Extend client

    Hi,
    I was wondering whether we can use WorkManager via Coherence Extend clients ?
    Thanks.
    -ali

    Hi,
    I was wondering whether we can use WorkManager via Coherence Extend clients ?
    Thanks.
    -ali

  • Best practice: Extend client re-connect attempts when cluster down?

    Hi,
    We have a basic extend TCP client that uses a few continuous queries to display data updated in a cluster. Due to the nature of the system it is possible for a client to be started before the cluster (and extend proxies) are available. When this happens the client throws the usual connection error upon trying to establish the initial connection but then doesn't attempt to reconnect after that. Once the cluster is up a client has to be restarted. Is there any way to configure the client to re-attempt connections at specified intervals?
    Regards.

    Hi,
    Maybe you can catch the exception, do a programmatical pause and then restart in a way like below:
    public class ShutdownInvocable extends AbstractInvocable
    public static class ShutdownTask implements Runnable
    public void run()
    CacheFactory.shutdown();
    public void run()
    (new Thread(new ShutdownTask())).start();
    Hope it helps.
    Regards,
    Cris

  • Does C# Extend Client know its' UUID?

    Hello,
    A few days ago I submitted a post about how my extend java client can obtain its' own connection ID (UUID), and was pointed to this code that works perfectly:
    NamedCache nc = CacheFactory.getCache("ABC");
    SafeCacheService svc = (SafeCacheService)nc.getCacheService();
    RemoteCacheService rsvc = (RemoteCacheService)svc.getCacheService();
    Channel ch = rsvc.getChannel();
    Connection con = ch.getConnection();
    UUID uid = con.getId();
    But now I need to know how C# client can obtain the same information. Could you please help?
    thank you,
    -- irene

    Irene,
    You can get the UUID in C# from
    INamedCache cache = CacheFactory.GetCache("ABC");
    SafeCacheService svc = (SafeCacheService)cache.CacheService;
    RemoteCacheService remoteCache = (RemoteCacheService)svc.CacheService;
    IChannel ch = remoteCache.Channel;
    IConnection con = ch.Connection;
    UUID uid = con.Id;
    Hope the above code will help you ......
    reg
    Dasun.

  • OutOfMemoryError in cluster after  TCP-extend client suspends processing.

    Anybody able to explain why the following exception might occur... seems to occur when a client connected through tcp-extend is suspended during continuous query processing.
    2007-12-20 21:19:49.009 Oracle Coherence GE 3.3.1/389 <Error> (thread=DistributedCache, member=1): Error sending MapEvent to Channel(Id=374515075, Connection=0x00000116F96C67F4A97BDC3A739C40D11DA1C36E3C50F9FBC8BB5AD8DCF4E16E, Open=true): java.lang.OutOfMemoryError: Direct buffer memory
    at java.nio.Bits.reserveMemory(Bits.java:633)
    at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:95)
    at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
    at com.tangosol.coherence.component.comm.connectionManager.acceptor.TcpAcceptor$ByteBufferPool.instantiateResource(TcpAcceptor.CDB:7)

    Hi,
    We are also getting same excpetion. "java.lang.OutOfMemoryError: Direct buffer memory". I have changed the -XX:MaxDirectMemorySize=256m still getting the same Exception. Tried to investigate by getting the log level to 7 still could not figure out the exact issue. We are running on 3.3.1/389p4 version of Coherence. Only thing I noticed was at times there are many connections in netstat -a o/p in CLOSE_WAIT position.
    Please Help!
    Regards,
    -Amit
    This Exception we are getting on TCP Extend Proxy nodes.
    2008-06-30 12:54:41.478 Oracle Coherence GE 3.3.1/389p4 <D6> (thread=DistributedCache, member=26): Outgoing ByteBufferPool increased to 266526720 bytes total
    2008-06-30 12:54:41.478 Oracle Coherence GE 3.3.1/389p4 <D6> (thread=DistributedCache, member=26): Outgoing ByteBufferPool increased to 266536960 bytes total
    2008-06-30 12:54:41.478 Oracle Coherence GE 3.3.1/389p4 <D6> (thread=DistributedCache, member=26): Outgoing ByteBufferPool increased to 266547200 bytes total
    2008-06-30 12:54:41.478 Oracle Coherence GE 3.3.1/389p4 <D6> (thread=DistributedCache, member=26): Outgoing ByteBufferPool increased to 266557440 bytes total
    2008-06-30 12:54:41.479 Oracle Coherence GE 3.3.1/389p4 <D6> (thread=DistributedCache, member=26): Outgoing ByteBufferPool increased to 266567680 bytes total
    2008-06-30 12:54:41.479 Oracle Coherence GE 3.3.1/389p4 <D6> (thread=DistributedCache, member=26): Outgoing ByteBufferPool increased to 266577920 bytes total
    2008-06-30 12:54:41.789 Oracle Coherence GE 3.3.1/389p4 <Error> (thread=DistributedCache, member=26): Error sending MapEvent to Channel(Id=1140491821, Connection=0x0000011AD950F44BAC1A65A1FB03F9B2AFAE8B5F9FF39688C81572023DF9F53B, Open=true): java.lang.OutOfMemoryError: Direct buffer memory
    at java.nio.Bits.reserveMemory(Bits.java:632)
    at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:95)
    at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
    at com.tangosol.coherence.component.comm.connectionManager.acceptor.TcpAcceptor$ByteBufferPool.instantiateResource(TcpAcceptor.CDB:7)
    at com.tangosol.coherence.component.comm.connectionManager.acceptor.TcpAcceptor$ByteBufferPool.acquire(TcpAcceptor.CDB:26)
    at com.tangosol.coherence.component.comm.connectionManager.acceptor.TcpAcceptor$ByteBufferPool.allocate(TcpAcceptor.CDB:4)
    at com.tangosol.io.MultiBufferWriteBuffer.advance(MultiBufferWriteBuffer.java:870)
    at com.tangosol.io.MultiBufferWriteBuffer.<init>(MultiBufferWriteBuffer.java:32)
    at com.tangosol.coherence.component.comm.connectionManager.acceptor.TcpAcceptor$TcpConnection.allocateWriteBuffer(TcpAcceptor.CDB:3)
    at com.tangosol.coherence.component.comm.Connection.send(Connection.CDB:16)
    at com.tangosol.coherence.component.comm.Channel.doSend(Channel.CDB:4)
    at com.tangosol.coherence.component.comm.Channel.send(Channel.CDB:38)
    at com.tangosol.coherence.component.net.extend.proxy.MapListenerProxy.onMapEvent(MapListenerProxy.CDB:9)
    at com.tangosol.coherence.component.net.extend.proxy.MapListenerProxy.entryInserted(MapListenerProxy.CDB:1)
    at com.tangosol.util.MapEvent.dispatch(MapEvent.java:191)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache$ViewMap$ProxyListener.dispatch(DistributedCache.CDB:22)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache$ViewMap$ProxyListener.entryInserted(DistributedCache.CDB:1)
    at com.tangosol.util.MapListenerSupport$WrapperSynchronousListener.entryInserted(MapListenerSupport.java:856)
    at com.tangosol.util.MapEvent.dispatch(MapEvent.java:191)
    at com.tangosol.coherence.component.util.CacheEvent.dispatchSafe(CacheEvent.CDB:14)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache$BinaryMap.dispatch(DistributedCache.CDB:86)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache.onMapEvent(DistributedCache.CDB:31)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache$MapEvent.onReceived(DistributedCache.CDB:3)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.onMessage(Service.CDB:9)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.onNotify(Service.CDB:130)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache.onNotify(DistributedCache.CDB:3)
    at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:35)
    at java.lang.Thread.run(Thread.java:595)

  • How can we close the TCP connection in Extend Clients (C#)

    I tried to use a C# client to connect to server side Coherence Nodes. The problem is that, Coherence creates two new TCP connections every time I create a new cache, and it never closes the connection. In the end, Coherence keeps opening hundreds connection for me, and I faced the Out Of Memory Exception.
    I used Coherence Extend for the connection, and use Thread.CurrentPrincipal. I did the same thing in Java, and it works. I don't know why it doesn't work for C#.
    For now, is there any way provided by Coherence to close the open TCP connection?

    The issue was the AZURE_STORAGE_CONNECTION_STRING was set improperly. I was originally using the value from the 'sig' querystring value, instead of the entire signature querystring.
    SET AZURE_STORAGE_CONNECTION_STRING=BlobEndpoint=https://viperprodstorage1.blob.core.windows.net/;SharedAccessSignature=<signature>
    Should have been...
    SET AZURE_STORAGE_CONNECTION_STRING=BlobEndpoint=https://viperprodstorage1.blob.core.windows.net/;SharedAccessSignature=sr=c&si=foobar-prod-policy&sig=<signature>
    After that was set, I was able to upload.
    I don't know if this mattered much, but I also changed the format of the call to...
    azure storage blob upload -f "file.gz" --container "foobar-prod" -b "file.gz" --verbose

  • Automatic Proxy Failover for Extend Client Connections

    Hi
    I looked at the documentation but this is a still unclear to me. We have a C++ application doing continuous puts/putAlls on a Coherence cluster through a set of storage disabled Proxy nodes. (I am guessing this is referred to as 'active' client?)
    Clients:
    Multiple C++ processes doing puts and putAlls via multiple proxy nodes
    Proxies:
    6 nodes acting purely as proxies without storage
    Servers:
    6 Storage nodes
    Each client has the addresses of all proxy nodes and ports. We are running a failover test where we kill a proxy node and see if the client fails over to next proxy that is alive. From what we see, this is not happening. Can someone explain what happens when a proxy server fails? I read in one of the forum responses that
    "For active client, when a request to proxy failed, the client will automatically connect to the next proxy server. But the reconnection only occurs the next request to proxy. It’s up to the client to retry the failed request."
    What does "retry the failed request" mean? - Is it - retry the PUT or PUTALL() that failed or retry getting the instance of the cache in C++ once I catch the socket failure exception in my code?
    Any pseudo code you can furnish would be very helpful
    Thank you
    Sairam

    As soon as we kill the proxy server that the client is connected to, we are getting the following socket disconnect exception, although other proxy nodes are up and running. What am I missing?
    terminate called after throwing an instance of 'coherence::lang::throwable_spec<coherence::net::messaging::ConnectionException, coherence::lang::extends<coherence::io::pof::PortableException, std::runtime_error>, coherence::lang::implements<void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void>, coherence::lang::throwable_spec<coherence::io::pof::PortableException, coherence::lang::extends<coherence::lang::RuntimeException, std::runtime_error>, coherence::lang::implements<coherence::io::pof::PortableObject, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void>, coherence::lang::throwable_spec<coherence::lang::RuntimeException, coherence::lang::extends<coherence::lang::Exception, std::runtime_error>, coherence::lang::implements<void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void>, coherence::lang::throwable_spec<coherence::lang::Exception, coherence::lang::extends<coherence::lang::Object, std::exception>, coherence::lang::implements<void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void>, coherence::lang::TypedHandle<coherence::lang::Object const> >::hierarchy>::hierarchy>::hierarchy>::bridge'
      what():  coherence::net::messaging::ConnectionException: coherence::component::util::TcpInitiator::TcpConnection@0xf511730{Id=0x0000012D76A6F7DB0A9869A922AC93E0ABB1489FC9E126BAC29CF570C15A218E, Open=1, LocalAddress=NULL, RemoteAddress=PosixRawSocketAddress[family=2]}: socket disconnect
        at virtual coherence::lang::TypedHandle<coherence::net::messaging::Response> coherence::component::net::extend::AbstractPofRequest::Status::getResponse()(AbstractPofRequest.cpp:189)
        at coherence::component::net::extend::AbstractPofRequest::Status::getResponse()
        at coherence::component::net::extend::AbstractPofRequest::Status::waitForResponse(long)
        at coherence::component::net::extend::PofChannel::request(coherence::lang::TypedHandle<coherence::net::messaging::Request>, long)
        at coherence::component::net::extend::PofChannel::request(coherence::lang::TypedHandle<coherence::net::messaging::Request>)
        at coherence::component::net::extend::RemoteNamedCache::BinaryCache::put(coherence::lang::TypedHandle<coherence::lang::Object const>, coherence::lang::TypedHolder<coherence::lang::Object>, long, bool)
        at coherence::component::net::extend::RemoteNamedCache::BinaryCache::put(coherence::lang::TypedHandle<coherence::lang::Object const>, coherence::lang::TypedHolder<coherence::lang::Object>)
        at coherence::util::WrapperCollections::AbstractWrapperMap::put(coherence::lang::TypedHandle<coherence::lang::Object const>, coherence::lang::TypedHolder<coherence::lang::Object>)
        at coherence::util::ConverterCollections::ConverterMap::put(coherence::lang::TypedHandle<coherence::lang::Object const>, coherence::lang::TypedHolder<coherence::lang::Object>)
        at coherence::component::net::extend::RemoteNamedCache::put(coherence::lang::TypedHandle<coherence::lang::Object const>, coherence::lang::TypedHolder<coherence::lang::Object>)
        at coherence::component::util::SafeNamedCache::put(coherence::lang::TypedHandle<coherence::lang::Object const>, coherence::lang::TypedHolder<coherence::lang::Object>)
        at CoherenceCache::insertData(std::string const&, std::string const&, std::string const&, unsigned long)
        at SessionManager::executeCacheOperation(int, std::string const&, std::string const&)
        at KeyPublisher::publishCycle()
        at VECLFunctor<KeyPublisher>::operator()()
        at VEThread::_run(void*)
        <stack frame symbol unavailable>
        on thread "Thread-1"
    Caused by: coherence::io::IOException: socket disconnect
        at virtual coherence::lang::size32_t coherence::net::Socket::readInternal(coherence::lang::octet_t*, coherence::lang::size32_t)(Socket.cpp:333)
        at coherence::net::Socket::readInternal(unsigned char*, unsigned int)
        at coherence::net::Socket::SocketInput::read(coherence::lang::SubscriptHandle<coherence::lang::Array<unsigned char>, unsigned char, unsigned int>, unsigned int, unsigned int)
        at coherence::io::BufferedInputStream::fillBuffer()
        at coherence::io::BufferedInputStream::read()
        at coherence::component::util::TcpInitiator::readMessageLength(coherence::lang::TypedHandle<coherence::io::InputStream>)
        at coherence::component::util::TcpInitiator::TcpConnection::TcpReader::onNotify()
        at coherence::component::util::Daemon::run()
        at coherence::lang::Thread::run()
        on thread "ExtendTcpCacheService:coherence::component::util::TcpInitiator:coherence::component::util::TcpInitiator::TcpConnection::TcpReader"See below our proxy and client configs
    Client:
    <remote-cache-scheme>
          <scheme-name>extend-dist</scheme-name>
          <service-name>ExtendTcpCacheService</service-name>
          <initiator-config>
            <tcp-initiator>
              <remote-addresses>
                <socket-address>
                  <address system-property="tangosol.coherence.proxy.address">10.152.105.169</address>
                  <port system-property="tangosol.coherence.proxy.port">9099</port>
                </socket-address>
              </remote-addresses>
             <remote-addresses>
                <socket-address>
                  <address system-property="tangosol.coherence.proxy.address">10.152.105.171</address>
                  <port system-property="tangosol.coherence.proxy.port">9099</port>
                </socket-address>
              </remote-addresses>
             <remote-addresses>
                <socket-address>
                  <address system-property="tangosol.coherence.proxy.address">10.152.105.170</address>
                  <port system-property="tangosol.coherence.proxy.port">9099</port>
                </socket-address>
              </remote-addresses>
             <remote-addresses>
                <socket-address>
                  <address system-property="tangosol.coherence.proxy.address">10.152.105.172</address>
                  <port system-property="tangosol.coherence.proxy.port">9099</port>
                </socket-address>
              </remote-addresses>
             <remote-addresses>
                <socket-address>
                  <address system-property="tangosol.coherence.proxy.address">10.152.105.173</address>
                  <port system-property="tangosol.coherence.proxy.port">9099</port>
                </socket-address>
              </remote-addresses>
              <connect-timeout>10s</connect-timeout>
            </tcp-initiator>
            <outgoing-message-handler>
              <request-timeout>5s</request-timeout>
            </outgoing-message-handler>
          </initiator-config>
        </remote-cache-scheme>
    Proxy:
    <!--
        Proxy Service scheme that allows remote clients to connect to the
        cluster over TCP/IP.
        -->
        <proxy-scheme>
          <service-name>ExtendTcpProxyService</service-name>
          <thread-count system-property="tangosol.coherence.extend.threads">25</thread-count>
          <acceptor-config>
            <tcp-acceptor>
              <local-address>
                <address system-property="tangosol.coherence.extend.address">localhost</address>
                <port system-property="tangosol.coherence.extend.port">9099</port>
              </local-address>
            </tcp-acceptor>
            <outgoing-message-handler>
              <request-timeout>10s</request-timeout>
            </outgoing-message-handler>
          </acceptor-config>
          <autostart>true</autostart>
        </proxy-scheme>
    ...Thanks
    Sairam
    Edited by: SKR on Jan 12, 2011 3:09 PM

  • How can I get a count of objects in the near cache? (Extend client)

    Hi,
    I'm trying to figure out how to get the count of objects in my near cache (from c++ client). Knowing the size of the near cache is a key factor when optimizing configurations for performance.
    However if I call size() on the cache handle I get the count of objects in the cache (ie the cluster). How can I get a count of objects in the near cache?
    Thanks
    Rich Carless

    H Rich,
    It may not be ideal, but I think you may be able to infer the size by using the HeapAnalyzer (http://download.oracle.com/docs/cd/E15357_01/coh.360/e15728/classcoherence_1_1lang_1_1_heap_analyzer.html) facility, specifically the "class" based HeapAnalyzer. Its Snapshot representation http://download.oracle.com/docs/cd/E15357_01/coh.360/e15728/classcoherence_1_1lang_1_1_class_based_heap_analyzer_1_1_snapshot.html provides a mapping between class name and ClassStats (http://download.oracle.com/docs/cd/E15357_01/coh.360/e15728/classcoherence_1_1lang_1_1_class_based_heap_analyzer_1_1_class_stats.html) which provides information on how many instances of a given class type are in memory. Note the reported counts are process wide but if your key or value type are distinct you may be able to infer your answer. I realize this is rather complex, my only other suggestion would be to just make some guesses on size and see how they effect performance.
    Mark
    Oracle Coherence

  • How to dynamically connect Extend client to proxy server?

    Hi,
    Is it possible to do programmatically? My client should decide at run time to which node it will connect.
    Thanks, Denis.

    Hi Denis,
    Yes you can do this, you need to write an implementation of com.tangosol.net.AddressProvider which provides your client with the InetSocketAddress it should connect to. Your implementation of AddressProvider can then work out the end-point however it likes. You configure your remote-cache-scheme or remote-invocation-scheme to use the Addressprovider instead of putting in socket-address entries.
    E.G. instead of this...
    <tcp-initiator>
      <remote-addresses>
        <socket-address>
          <address>192.456.789</address>
          <port>10000</port>
        </socket-address>
      </remote-addresses>
    </tcp-initiator>you do this...
    <tcp-initiator>
      <remote-addresses>
        <address-provider>
          <class-name>com.jk.MyAddressProvider<class-name>
        <address-provider>
      </remote-addresses>
    </tcp-initiator>If you need to parameterise your AddressProvider you can add init-param entries to the config in the usual way.
    JK

Maybe you are looking for