Clearing the cache of remote server

I’m writing a flow service to clear Cache of other Integration servers. Generally when we click on Reset server cache it calls the URL http://servername:port/WmRoot/stats-services.dsp?action=resetcache. I need to call this URL, tried using pub.client.http but doesn’t seems to be working. Any ideas hoe to make this work or any other work around and also please let me know the disadvantages of clearing the cache in this way

Hi Vinod,

try to find out what is called exactly when you click on the link.

Then locate this service in WmRoot-package and try to call it with pub.client:remoteInvoke

See Built-In-Services-Guide for details.

Can you elaborate on the use case you are trying achieve?

Regards,
Holger

1 Like

Make use of “pub.client:remoteInvoke” to clear the service cache remotely on other IS’s. Make sure you setup of the remote server alias of all IS’s on your local IS (from where are invoking pub.client:remoteInvoke)

Can you provide your wM version, I remember that there were few additions to the cache services in WmPublic package.

Thanks Holder & Mahesh for responding.

Im using versions 8.2, 9.6 & 9.8. I’m aware of the remote invoke service which you guys said. But the problem is that I don’t know the exact service to call to clear the cache.

Holger I was not able to find the service in WmRoot for this. The main reason is I’m not supposed to enable WmRoot package in my project.
Mahesh there is a pub service for this pub.cache.admin:clearCache but not sure what to give the inputs for this cacheManagerName & cacheName

The service name is “wm.server.cache:resetCache” which is present in WmRoot. Use this service at your own risk.

1 Like

If you want to make use of the sevice pub.cache.admin:clearCache then pass the inputs as below: Make sure you test this on dev server before implementing this soln.

cacheManagerName=“SoftwareAG.IS.Services”
cacheName=“ServiceResults”

1 Like

Thanks a lot Mahesh, will definitely try both and will let you know the outcome.

Its working Mahesh, thanks a lot

HI Mahesh,

Is there a way to find out whether the service wm.server.cache:resetCache ran successfully or a way to capture the error if anything occurs while the service is running or it fails to run.

Hi Mahesh,
unfortunately, I get the error message “Cannot clear the contents of a system cache.” when I try it with following input:
cacheManagerName=“SoftwareAG.IS.Services”
cacheName=“NameOfMyServiceOutput

Any idea?

Best regards,
Marcus

The above is an example to use the service however the service will not work for the system cache and it is only for the user-defined cache. Refer WmRoot package you will find one to clear the system defined cache else let me know.

As pub.cache.admin:clearCache cannot clear system caches, I have looked for wm.server.cache:resetCache in the WmRoot package, but cannot figure its input signature. When testing this service on IS’ Admin UI, it does ask for any inputs. This could either mean it resets all service caches or the Admin UI doesn’t recognize the input signature. Can anybody help, please?

Hi,

wm.server.cache:resetCache has an Input as serviceName.
There is another service wm.server.cache.adminui:resetCache, which does not have any inputs.

As written above, both services should be used with caution as they are internal services usually not meant for manual invocation.

Regards,
Holger

1 Like