Forum Stats

  • 3,815,713 Users
  • 2,259,070 Discussions
  • 7,893,213 Comments

Discussions

Is it possible that com.tangosol.util.processor.AsynchronousProcessor is not supported through POF s

962259
962259 Member Posts: 55
edited Oct 12, 2018 1:22PM in Coherence Support

From an extend client application, I am running an asynchronous entry processor on a cache and getting the following error:

2018-10-11 13:21:59.928/5.126 Oracle Coherence GE 12.2.1.2.1 <Error> (thread=main, member=n/a): An exception occurred while encoding a InvokeRequest for Service=TcpExtendCSP:TcpInitiator: java.lang.IllegalArgumentException: unknown user type: com.tangosol.util.processor.AsynchronousProcessor

at com.tangosol.io.pof.ConfigurablePofContext.getUserTypeIdentifier(ConfigurablePofContext.java:441)

at com.tangosol.io.pof.ConfigurablePofContext.getUserTypeIdentifier(ConfigurablePofContext.java:430)

at com.tangosol.coherence.component.net.extend.Channel.getUserTypeIdentifier(Channel.CDB:7)

at com.tangosol.io.pof.PofBufferWriter.writeUserType(PofBufferWriter.java:1927)

at com.tangosol.io.pof.PofBufferWriter.writeObject(PofBufferWriter.java:1865)

at com.tangosol.coherence.component.net.extend.messageFactory.NamedCacheFactory$InvokeRequest.writeExternal(NamedCacheFactory.CDB:3)

at com.tangosol.coherence.component.net.extend.Codec.encode(Codec.CDB:36)

at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.encodeMessage(Peer.CDB:23)

at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.send(Peer.CDB:17)

at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.post(Peer.CDB:16)

at com.tangosol.coherence.component.net.extend.Channel.post(Channel.CDB:25)

at com.tangosol.coherence.component.net.extend.Channel.request(Channel.CDB:18)

at com.tangosol.coherence.component.net.extend.Channel.request(Channel.CDB:1)

at com.tangosol.coherence.component.net.extend.RemoteNamedCache$BinaryCache.invoke(RemoteNamedCache.CDB:12)

at com.tangosol.util.ConverterCollections$ConverterInvocableMap.invoke(ConverterCollections.java:620)

at com.tangosol.util.ConverterCollections$ConverterNamedCache.invoke(ConverterCollections.java:1104)

at com.tangosol.coherence.component.net.extend.RemoteNamedCache.invoke(RemoteNamedCache.CDB:1)

at com.tangosol.coherence.component.util.SafeNamedCache.invoke$Router(SafeNamedCache.CDB:1)

at com.tangosol.coherence.component.util.SafeNamedCache.invoke(SafeNamedCache.CDB:5)

POF is enabled everywhere.

Runs fine with a regular entry processor.

Is it possible that com.tangosol.util.processor.AsynchronousProcessor is not supported with POF serialization?

I am using Coherence version 12.2.1.2.3 (actually coherence-java-12.2.1.2.3b72246-Int)

Best Answer

Answers

  • Tmiddlet-Oracle
    Tmiddlet-Oracle Member Posts: 125
    edited Oct 11, 2018 9:58PM

    Can you please confirm the coherence version as you mentioned coherence-java-12.2.1.2.3b72246-Int but i see 12.2.1.2.1 in the log output?

    Please confirm all client and cache server versions are the same.

    Tim

  • User_AA37N
    User_AA37N Member Posts: 10 Red Ribbon
    edited Oct 12, 2018 4:06AM Answer ✓

    I had the same issue a few days ago. Look the notes on the official Coherence 12.2.1 API java documentation.

    Note 2: This feature is not available on Coherence*Extend clients.

    Note 1: Neither this class nor its extensions need to be serializable.

    Only the underlying processor is serialized and sent to corresponding servers for execution.

    Ref: https://docs.oracle.com/cd/E57014_01/coherence/java-reference/com/tangosol/util/processor/AsynchronousProcessor.html

    Might be you could achieve the same functionality using a couple InvocationServices Synchronous/Asynchronous

    Regards

    Michel

  • 962259
    962259 Member Posts: 55
    edited Oct 12, 2018 9:55AM

    Hi Tim,

    Wrong copy/paste, same problem with exact Coherence version match between Extend client and server side:

    2018-10-12 09:52:31.603/9.732 Oracle Coherence GE 12.2.1.2.3 <Error> (thread=main, member=n/a): An exception occurred while encoding a InvokeRequest for Service=TcpExtendCSP:TcpInitiator: java.lang.IllegalArgumentException: unknown user type: com.tangosol.util.processor.AsynchronousProcessor

    at com.tangosol.io.pof.ConfigurablePofContext.getUserTypeIdentifier(ConfigurablePofContext.java:441)

    at com.tangosol.io.pof.ConfigurablePofContext.getUserTypeIdentifier(ConfigurablePofContext.java:430)

    at com.tangosol.coherence.component.net.extend.Channel.getUserTypeIdentifier(Channel.CDB:7)

    at com.tangosol.io.pof.PofBufferWriter.writeUserType(PofBufferWriter.java:1927)

    at com.tangosol.io.pof.PofBufferWriter.writeObject(PofBufferWriter.java:1865)

    at com.tangosol.coherence.component.net.extend.messageFactory.NamedCacheFactory$InvokeRequest.writeExternal(NamedCacheFactory.CDB:3)

    at com.tangosol.coherence.component.net.extend.Codec.encode(Codec.CDB:36)

    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.encodeMessage(Peer.CDB:23)

    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.send(Peer.CDB:17)

    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.post(Peer.CDB:16)

    at com.tangosol.coherence.component.net.extend.Channel.post(Channel.CDB:25)

    at com.tangosol.coherence.component.net.extend.Channel.request(Channel.CDB:18)

    at com.tangosol.coherence.component.net.extend.Channel.request(Channel.CDB:1)

    at com.tangosol.coherence.component.net.extend.RemoteNamedCache$BinaryCache.invoke(RemoteNamedCache.CDB:12)

    at com.tangosol.util.ConverterCollections$ConverterInvocableMap.invoke(ConverterCollections.java:620)

    at com.tangosol.util.ConverterCollections$ConverterNamedCache.invoke(ConverterCollections.java:1104)

    at com.tangosol.coherence.component.net.extend.RemoteNamedCache.invoke(RemoteNamedCache.CDB:1)

    at com.tangosol.coherence.component.util.SafeNamedCache.invoke$Router(SafeNamedCache.CDB:1)

    at com.tangosol.coherence.component.util.SafeNamedCache.invoke(SafeNamedCache.CDB:5)

  • 962259
    962259 Member Posts: 55
    edited Oct 12, 2018 10:15AM

    Tks Michel, sometimes I forget that the API documentation is often a good source of documentation...but would have been nice to put a note in the main documentation - https://docs.oracle.com/middleware/12213/coherence/develop-applications/processing-data-cache.htm#COHDG5873

    I cannot currently use your clever alternative as I cannot for now deploy this entry processor / invocation service on the cluster side - my solution cannot require a server restart or rolling restart.  I must use an entry processor through a lambda expression which permits me to not declare a new POF type for this entry processor.

    So it looks like it is due to current implementation limitation.  I suspect that there are underlying design or code imitation reasons, otherwise it would be nice to request for future support of AsynchronousProcessor for POF/std serialization Extend clients.

    @Tim - do you want me to create an SR so you can link this feature request to a customer SR?

  • 1068530
    1068530 Member Posts: 1
    edited Oct 12, 2018 11:37AM

    As Michel pointed out, async API in general is not supported via Extend.

    The issue has nothing to do with POF or serialization in general, but with a fact that Extend itself is designed as a synchronous protocol and has no support for async invocation on the client side.

    While we could write an async version of Extend, I really don't see a point of investing into it when there are things such as gRPC out there, which not only supports both async and sync clients, but also works better with proxies, is better documented, supports more clients/platforms, etc.

    Long story short, the plan is to either replace current, proprietary Extend protocol with a gRPC-based implementation at some point, or to provide gRPC server (and various clients) as add-ons, likely under coherence-community umbrella, so they can be used with existing versions of Coherence as well (likely >= 12.2.1)

    Regards,

    Aleks

  • 962259
    962259 Member Posts: 55
    edited Oct 12, 2018 12:41PM

    Tks Aleks, understandable.

  • User_AA37N
    User_AA37N Member Posts: 10 Red Ribbon
    edited Oct 12, 2018 1:22PM

    Asynchronous Invocation service through ProxyExtend can be found here https://thegridman.com/coherence/coherence-alternative-putall-2/

    It's not only a clever one but it's also robust and tested  in production across different Coherence versions from 3.7.1 to 12.2.1

    Credits to JK, after this post I started seeing Coherence with new eyes, a long time ago. Take home here is Asynchronous processing

    over ProxyExtend wire without losing Partition targeted processing.

    "Any changes or additions of new lambda expressions on the client require a redeployment and restart of both the client and the server"

    This is well documented in the official Coherence documentation. Sooner or later you will need to talk with someone at the other side of the ocean

    to restart your Coherence services instances in production.

    Here at the best source of Coherence documentation  : coherence-pof-config.xml. If you managed to open that file already inside the jar

    file coherence.jar you will quickly notice that com.tangosol.util.processor.AsynchronousProcessor is not registered in the main pof config file.

    Apart from the official Coherence documentation you shall have a look at files coherence-cache-config.xsd, coherence-operational-config.xsd

    and coherence-pof-config.xsd. Everything is in there.

    Regards

    Michel