wso2/product-apim

Mediator sequence files are not getting restored after API re-deployment

gbidsilva opened this issue · 1 comments

Description:

Custom mediator related sequence files which are placed under 'repository/deployment/server/synapse-configs/default/sequences' directory are getting deleted once the respective API is redeployed and upon successful redeployment, deleted sequence files are not getting restored properly. Therefore, custom mediation classes are not getting invoked properly.
However, in carbon log, it is logged that respective sequence file removal and restoration but, it is not happenining properly it seems.

Undeploying events during the redeploy....

[2022-04-01 01:40:15,664]  INFO - CarbonAuthenticationUtil 'admin@carbon.super [-1234]' logged in at [2022-04-01 01:40:15,664-0700]
[2022-04-01 01:40:15,681]  INFO - API {api:admin--testbuddhi1:v1.00} Destroying API: admin--testbuddhi1:v1.00
[2022-04-01 01:40:15,722]  INFO - DependencyTracker API : admin--testbuddhi1:v1.00 was removed from the Synapse configuration successfully
[2022-04-01 01:40:15,723]  INFO - DependencyTracker Sequence : admin--testbuddhi1:v1.00--Out was  removed from the Synapse configuration successfully
[2022-04-01 01:40:15,724]  INFO - DependencyTracker Local entry : c5eed0b6-8ac7-4251-aa6f-692c899e87ea was removed from the Synapse configuration successfully
[2022-04-01 01:40:15,776]  INFO - CarbonAuthenticationUtil 'admin@carbon.super [-1234]' logged in at [2022-04-01 01:40:15,776-0700]
[2022-04-01 01:40:15,779]  INFO - DataBridge user admin connected

deploying events during the redeploy

[2022-04-01 01:40:37,200]  INFO - CarbonAuthenticationUtil 'admin@carbon.super [-1234]' logged in at [2022-04-01 01:40:37,200-0700]
[2022-04-01 01:40:37,233]  INFO - DependencyTracker Local entry : c5eed0b6-8ac7-4251-aa6f-692c899e87ea was added to the Synapse configuration successfully
[2022-04-01 01:40:37,249]  INFO - DependencyTracker Endpoint : testbuddhi1--v1.00_APIsandboxEndpoint was added to the Synapse configuration successfully
[2022-04-01 01:40:37,258]  INFO - DependencyTracker Endpoint : testbuddhi1--v1.00_APIproductionEndpoint was added to the Synapse configuration successfully
[2022-04-01 01:40:37,271]  INFO - DependencyTracker API : admin--testbuddhi1:v1.00 was added to the Synapse configuration successfully
[2022-04-01 01:40:37,272]  INFO - API {api:admin--testbuddhi1:v1.00} Initializing API: admin--testbuddhi1:v1.00
[2022-04-01 01:40:37,369]  INFO - CarbonAuthenticationUtil 'admin@carbon.super [-1234]' logged in at [2022-04-01 01:40:37,369-0700]

However, there is another way we can add class mediator through sequence files into WSO2. Which is through the WSO2 UI. In this way, this works fine - means that after redeployment completes, it will restore the sequence file again.

Steps to reproduce:

Create a custom class mediator sequence file and place it under sequence directory and redeploy the respective API.

Sample sequence file is given below,

<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="WSO2AM--Ext--Out">
    <class name="mediator.DummyOutFlowMediator"/>
</sequence>

Affected Product Version:

wso2am-3.2.0.140

Environment details (with versions):

  • OS: Linux (Ubuntu)
  • Client: NA
  • Env (Docker/K8s): VM