IBM Support

Cloud Pak for Security: How to clear message destination queue in CP4S

How To


Summary

How to clear message destination queue in CP4S in v1.10.x.

Objective

A message destination can contain old messages that can trigger warnings or can cause performance issues. If messages are no longer required to be processed, the queues can be deleted.

Steps

Clear the message destination queue.

  1. Log in to the cluster by using either of the following commands.
    • Using a username and password: 
      oc login <openshift_url> -u <username> -p <password>
    • Using a token, which you can get from Red Hat OpenShift web console:
      oc login --token=<token> --server=<openshift_url>
  2. To obtain the activemq password enter: 
    oc get secrets/isc-cases-db-passwords --template={{.data.activemq_password}} | base64 -d
  3. Retrieve and take note of the postgres-svc ClusterIP address.
    oc get svc/soar-postgres-svc 
  4. Confirm you can open psql connection from default-postgres-keeper-0.
    oc exec -it default-postgres-keeper-0 -- bash 
  5. Run psql on the activemq database and enter the password that you decoded.
    Note: Replace <ClusterIP> with the IP Address of the Cluster that you received earlier.
    psql -U activemq -d activemq -h <ClusterIP> -p 5432 -c "select container, count(*) from activemq_msgs group by container order by container" 
  6. Check the message count in bytes
    psql -U activemq -d activemq -h <ClusterIP> -p 5432 -c "select container, count(*), sum(length(msg)) as bytes from activemq_msgs group by container order by container;"
    Example output:
                  container              | count | bytes 
    -------------------------------------+-------+-------
     queue://actions.201.digital_shadows |     4 | 28907
     queue://actions.201.fn_utilities    |     2 |  3816
    
  7. Delete the 'actions.201.digital_shadows' queue: 
    psql -U activemq -d activemq -h <ClusterIP> -p 5432 -c "DELETE FROM activemq_msgs WHERE container = 'queue://actions.201.digital_shadows'"
    Example output:
    Output:
    
                container             | count 
    ----------------------------------+-------
     queue://actions.201.fn_utilities |     2
    
    
                container             | count | bytes 
    ----------------------------------+-------+-------
     queue://actions.201.fn_utilities |     2 |  3816
    

    Result
    The output confirms the 'actions.201.digital_shadows' message queue was deleted.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSTDPP","label":"IBM Cloud Pak for Security"},"ARM Category":[{"code":"a8m0z0000001h8pAAA","label":"Support-\u003ECases"}],"ARM Case Number":"TS010882354","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.10.0"}]

Document Information

Modified date:
05 June 2025

UID

ibm16840729