首页 > 解决方案 > 是否可以在 HTTP Endpoint 中使用特殊字符作为变量而不对其进行编码?

问题描述

因此,我尝试使用 WSO2 Entreprise Integrator 7.1.0 将数据发送到 MQTT 代理,并根据数据源使用变量更改主题名称。

我要使用的主题名称结构是/location/type/model/uniqueId/count

我可以通过此配置使用静态主题名称将数据发布到我的 MQTT 代理:

带地址端点

mqtt:/SampleProxy?mqtt.server.host.name=localhost&mqtt.server.port=1883&mqtt.client.id=esb.test.sender2&mqtt.subscription.qos=2&mqtt.blocking.sender=true&mqtt.topic.name=/canada/detector/det-01-001/count

此方法运行良好,但我无法在地址端点中使用变量,因此在将数据发送到 mqtt 代理之前,我无法更改属性名称的 det-01-001。

使用 HTTP 端点

mqtt:/SampleProxy?mqtt.server.host.name=localhost&mqtt.server.port=1883&mqtt.client.id=esb.test.sender2&mqtt.subscription.qos=2&mqtt.blocking.sender=true&mqtt.topic.name={uri.var.topics}

和我的财产uri.var.topics

<property description="Topic" name="uri.var.topic" scope="default" type="STRING" value="/canada/detector/det-01-001/count"/>

此方法有效,但将每个字符“/”更改为它的ASCII 编码参考“%2F”。

这种存在的结果%2Fcanada%2Fdetector%2Fdet-01-001%2Fcount

有没有办法解码“/”字符或防止端点对其进行编码的选项?

标签: wso2wso2ei

解决方案


推荐阅读