重新启动后删除WSO2 APIM自定义错误消息
我根据文档在APIM中添加了一些自定义错误消息 httpps ://apim.docs.wso2.com/en/4.0.0/troubleshooting/errorhandling/ - 我在 < api-m_home>/repository/deploymention/deployment/server/synapse-configs/default/sequences
并在该目录中的某些默认文件中添加了对该文件的引用错误信息)。
在WSO2的重新启动之前,一切似乎都很好,此后,对默认文件进行了更改,但是删除了自定义文件,因此自定义错误消息处理不起作用。
我通过在文件中添加不可移动的属性(chattr +i
)来解决此问题,但是我想知道是否有其他更优雅的方法可以防止每次重新启动进行删除文件?
I added some custom error messages to the APIM according to documentation https://apim.docs.wso2.com/en/4.0.0/troubleshooting/error-handling/ - I created custom file in<API-M_HOME>/repository/deployment/server/synapse-configs/default/sequences
and added references to that file in some of the default files in that directory (so that it is called to transform error message).
Everything seemed to be working just fine until the restart of WSO2 - after that, changes made to default files were present, but the custom file was removed, so that custom error message handling didn't work.
I resolved this by adding non-removable attribute (chattr +i
) to the file, but I wonder is there other, more elegant way to prevent the file from being deleted every time restart is being made?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在:
&lt; api-m_home&gt;/repository/resources/apim-synapse-config
中放置了“模板”文件。也许这些文件是../ Synapse-Configs/default/
位置中的文件。我想到的第二件事是使用特定的高空能方案。在系统中共享文件作为内容同步机制中的工件,它可以覆盖本地更改。
There are 'template' files placed in:
<API-M_HOME>/repository/resources/apim-synapse-config
. Maybe, those files are overriding files in the../synapse-configs/default/
location.Second thing, which came on my mind, is using specific High Avability scenario. Where artifacts are shared files in system as the content synchronization mechanism, it can override local changes.
在启动网关上,删除了这些文件。您可以将以下配置添加到exployment.toml,然后将文件放入序列目录中。
示例配置:
对于您的情况:
请参阅 - https://apim.docs.wso2.com/en en/latest/install--install-andstall-andstall-and-setup/setup/setup/setup/setup/distributed-部署/部署WSO2-API-M-In-A-In-A-a-a-a-a-a-in-a-n-setup/#configure-the-gateway-nodes
At the startup gateway removes these files. You can add the following configuration to the deployment.toml and place the file in the sequence directory.
Sample Config:
For your case:
Refer - https://apim.docs.wso2.com/en/latest/install-and-setup/setup/distributed-deployment/deploying-wso2-api-m-in-a-distributed-setup/#configure-the-gateway-nodes