We are using solace-cache/solcache in our project. In our dev environment its very difficult for us to go to solace admins to request for a cache refresh.

My question is:

Using the solace java API, is there a way we could clear up our entire solace cache instance and/or is there a way for us to delete specific keys already stored in the cache ?

If not, are there any simple commands that we could use to do this using the SEMP protocol without needing full admin rights to solace appliances?

Thanks,

1 Answers

2
Russell Sim On

The easiest option is to actually request for a limited management account with only read/write permission on your message-vpn from your adminstrators. Then, you can make use of the management tools such as SolAdmin to manage your VPN.

Failing that, this can be done by executing the a SEMP over message bus command. Publish the following message to topic #SEMP/<router name>/ADMIN/DISTRIBUTED-CACHE

<rpc>
    <admin>
        <distributed-cache>
            <name>myDistributedCacheName</name>
            <vpn-name>myVpnName</vpn-name>
            <delete-messages>
                <topic>my/topic/name</topic>
            </delete-messages>
        </distributed-cache>
    </admin>
</rpc>

Wildcards can be specified in the topic string. For example, using a topic string of ">" will delete all messages in the cache.

Note that your message-vpn must be configured to:

  • Allow SEMP over Message Bus
  • Allow Admin Commands
  • Allow Distributed Cache Commands

Details on enabling these features in your message-vpn can be found here.

Details on Publishing SEMP Requests over the Message Bus can be found here. Alternatively, refer to the SempGetOverMB.java sample that is provided with the Solace Java API.