ESB Mule - 如何查看用于命中 HTTP 组件的动态 URL
ESB Mule - how to see the dynamic URL which is used to hit in the HTTP component
我是 mule ESB 的新手。
我设计了如下流程。
我喜欢看到请求 URL 动态构建以命中 REST API。我试过调试一个流程。我在 "Call_HTTPS_REST_API" http 组件上设置了一个断点。在那里我可以看到有效载荷。但是URL我看不到任何地方。
请帮我找到打服务的动态URL
注意 - 我尝试使用 system.out.println 打印变量 (dynamicEndpoint)。虽然我喜欢看到用于点击服务的url。
请查找流量配置xml。
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:wmq="http://www.mulesoft.org/schema/mule/ee/wmq" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/wmq http://www.mulesoft.org/schema/mule/ee/wmq/current/mule-wmq-ee.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8085" basePath="/mule" doc:name="HTTP Listener Configuration"/>
<http:request-config name="HTTP_Request_Configuration" host="#[dynamicEndpoint]" port="443" doc:name="HTTP Request Configuration" protocol="HTTPS" >
</http:request-config>
<flow name="secondflowFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<custom-transformer class="com.mule.URLBuilding.BuildURL" doc:name="Java"/>
<http:request config-ref="HTTP_Request_Configuration" method="POST" path="/" doc:name="Call_HTTPS_REST_API">
<http:success-status-code-validator values="0..599"/>
</http:request>
</flow>
</mule>
只需添加一个记录器并记录#[dynamicEndpoint]
<logger message="#[dynamicEndpoint]" level="INFO" doc:name="Logger"/>
如果您创建了一个变量,您应该会在变量选项卡上的调试器中看到它,目前您可能没有变量,或者您可能在 Java 代码中创建了它。否则创建一个值为 #[dynamicEndpoint]
的 flowVars
我是 mule ESB 的新手。
我设计了如下流程。
我喜欢看到请求 URL 动态构建以命中 REST API。我试过调试一个流程。我在 "Call_HTTPS_REST_API" http 组件上设置了一个断点。在那里我可以看到有效载荷。但是URL我看不到任何地方。
请帮我找到打服务的动态URL
注意 - 我尝试使用 system.out.println 打印变量 (dynamicEndpoint)。虽然我喜欢看到用于点击服务的url。
请查找流量配置xml。
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:wmq="http://www.mulesoft.org/schema/mule/ee/wmq" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/wmq http://www.mulesoft.org/schema/mule/ee/wmq/current/mule-wmq-ee.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8085" basePath="/mule" doc:name="HTTP Listener Configuration"/>
<http:request-config name="HTTP_Request_Configuration" host="#[dynamicEndpoint]" port="443" doc:name="HTTP Request Configuration" protocol="HTTPS" >
</http:request-config>
<flow name="secondflowFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<custom-transformer class="com.mule.URLBuilding.BuildURL" doc:name="Java"/>
<http:request config-ref="HTTP_Request_Configuration" method="POST" path="/" doc:name="Call_HTTPS_REST_API">
<http:success-status-code-validator values="0..599"/>
</http:request>
</flow>
</mule>
只需添加一个记录器并记录#[dynamicEndpoint]
<logger message="#[dynamicEndpoint]" level="INFO" doc:name="Logger"/>
如果您创建了一个变量,您应该会在变量选项卡上的调试器中看到它,目前您可能没有变量,或者您可能在 Java 代码中创建了它。否则创建一个值为 #[dynamicEndpoint]
的 flowVars