Mulesoft自定义策略转换扩展
我正在为mulesoft runtime 4.1.0开发一个自定义验证器策略,当策略不满足时,我需要修改响应。为此,我在mulesoft文档中找到了这个页面:但是当我尝试使用xml名称空间http转换时:我总是得到错误 加载错误: /opt/mule/mule-4.1.2/policies/jwtvalidatorpolicy-315114/policy.xml, 无法解决 , 可能缺少依赖项或插件 有人能提供正确的位置/命名空间吗Mulesoft自定义策略转换扩展,mule,mule-component,anypoint-studio,mule-esb,cloudhub,Mule,Mule Component,Anypoint Studio,Mule Esb,Cloudhub,我正在为mulesoft runtime 4.1.0开发一个自定义验证器策略,当策略不满足时,我需要修改响应。为此,我在mulesoft文档中找到了这个页面:但是当我尝试使用xml名称空间http转换时:我总是得到错误 加载错误: /opt/mule/mule-4.1.2/policies/jwtvalidatorpolicy-315114/policy.xml, 无法解决 , 可能缺少依赖项或插件 有人能提供正确的位置/命名空间吗 谢谢大家! 这里是一个使用上述扩展的完整示例 <
谢谢大家! 这里是一个使用上述扩展的完整示例
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:http-policy="http://www.mulesoft.org/schema/mule/http-policy"
xmlns:http-transform="http://www.mulesoft.org/schema/mule/http-policy-transform"
xmlns="http://www.mulesoft.org/schema/mule/core"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http-policy-transform http://www.mulesoft.org/schema/mule/http-policy-transform/current/mule-http-policy-transform.xsd
http://www.mulesoft.org/schema/mule/http-policy http://www.mulesoft.org/schema/mule/http-policy/current/mule-http-policy.xsd">
<http-policy:proxy name="policy-deployment">
<http-policy:source>
<try>
<http-policy:execute-next/>
<http-transform:add-headers outputType="response">
<http-transform:headers>#[{'policyHeader': 'policyHeaderValue'}]</http-transform:headers>
</http-transform:add-headers>
</try>
</http-policy:source>
</http-policy:proxy>
</mule>
#[{'policyHeader':'policyHeaderValue'}]
您还需要将以下依赖项添加到自定义策略项目中
<dependency>
<groupId>com.mulesoft.anypoint</groupId>
<artifactId>mule-http-policy-transform-extension</artifactId>
<version>1.1.0</version>
<classifier>mule-plugin</classifier>
</dependency>
com.mulesoft.anypoint
mule-http策略转换扩展
1.1.0
mule插件
对于同样遇到缺少依赖性问题的人:
这是一个企业专用插件。这意味着您需要配置maven设置文件,以便也在mulesoft enterprise repo中进行搜索。有关如何执行此操作的文档,请参阅。如果您还没有此回购的用户名/密码,请使用链接到您的企业订阅的帐户创建支持票证,他们将为您提供正确的凭据。您好,刚刚尝试过,但是在执行
mvn clean package
时,错误是无法解析项目c1e9319b-e4de-4d6d-9d31-7b603642fea8的依赖项:jwtvalidatorpolicy:mule policy:0.6.0-SNAPSHOT:在mulesoft版本中找不到工件com.mulesoft.anypoint:mule http策略转换扩展:jar:mule插件:1.1.0(https://repository.mulesoft.org/releases/)
我遗漏了什么?