重新启动后删除WSO2 APIM自定义错误消息

发布于 2025-02-10 17:16:56 字数 551 浏览 3 评论 0原文

我根据文档在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

虫児飞 2025-02-17 17:16:56

在:&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.

飘过的浮云 2025-02-17 17:16:56

在启动网关上,删除了这些文件。您可以将以下配置添加到exployment.toml,然后将文件放入序列目录中。

示例配置:

[apim.sync_runtime_artifacts.gateway.skip_list]
apis = ["api1.xml","api2.xml"]
endpoints = ["endpoint1.xml"]
sequences = ["post_with_nobody.xml"]
local-entries = ["file.xml"]

对于您的情况:

[apim.sync_runtime_artifacts.gateway.skip_list]
sequences = ["name_of_the_file.xml"]

请参阅 - 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:

[apim.sync_runtime_artifacts.gateway.skip_list]
apis = ["api1.xml","api2.xml"]
endpoints = ["endpoint1.xml"]
sequences = ["post_with_nobody.xml"]
local-entries = ["file.xml"]

For your case:

[apim.sync_runtime_artifacts.gateway.skip_list]
sequences = ["name_of_the_file.xml"]

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文