cache request on python

Chris
Chris Member Posts: 7

I use CachedMessageSubscriptionRequest.cached_first to call cache data

but I got Fail on_completion
CacheRequestOutcomeListenerHandler:CacheRequestOutcome.FAILED, cache_request_id:3 exception:Unable to send cache request.
Caller Description: On cache request send. Error Info Sub code: [1]. Error: [Only SOLCLIENT_CACHEREQUEST_FLAGS_LIVEDATA_FLOWTHRU allowed with wildCard topic xxxx/xxxxxxx
on session (c1,s1)_api]. Sub code: [SOLCLIENT_SUBCODE_PARAM_OUT_OF_RANGE]. Return code: [Fail]

What is this mean?

Best Answer

  • Ragnar
    Ragnar Member, Employee Posts: 67 Solace Employee
    #2 Answer ✓

    Hi Chris,

    This indicates that the API did not get a response from the distributed cache.

    • Have you configured theSolCache name correctly in the request?
    • Is the SolCache up and active?
    • Is your client on the same VPN as the SolCache

    There could be other network issues at play as well but for starters these are the most common issues.

    Ragnar

Answers

  • Ragnar
    Ragnar Member, Employee Posts: 67 Solace Employee

    Hi Chris,

    The PubSub+ API for Python only allows 'as_available' for wild-card topic subscriptions.

    If you wish to received cached data before live data, (cached_first), you must use an exact match topic subscription without wildcards ('*' or ending in '>').

    Regards

    Ragnar

  • Chris
    Chris Member Posts: 7

    Hi Ranger,

    Thanks for you answer.
    I change the topic to specific subscription.

    And the CacheRequestOutcomeListenerHandler's on_completion funcction get Fail.

    The exception:"The cache request timed out, this error was generated from event: _SolCacheEventInfo:
    Cache Event Type: _SOLCLIENTCACHEEVENT.SOLCACHE_EVENT_REQUEST_COMPLETED_NOTICE(0)
    Topic: xxxx/xxxx/x/xxx/xxxx/xxx
    Return Code: Incomplete(7)
    Sub Code: SOLCLIENT_SUBCODE_CACHE_TIMEOUT(55)
    Cache Request ID: 1
    Cache Session ID: 2318934085456
    "

    can you tell me why I get this? My topic is simple data I think it don't take much time but I got time out.

  • Ragnar
    Ragnar Member, Employee Posts: 67 Solace Employee
    #5 Answer ✓

    Hi Chris,

    This indicates that the API did not get a response from the distributed cache.

    • Have you configured theSolCache name correctly in the request?
    • Is the SolCache up and active?
    • Is your client on the same VPN as the SolCache

    There could be other network issues at play as well but for starters these are the most common issues.

    Ragnar

  • Chris
    Chris Member Posts: 7

    Hi Ranger,

    Thank you so much. I figure out the problem I don't set the right SolCache name.