My APIGEE API proxy base path is /ident/post/webhooks, and when the full url https://apigee.url.com//ident/post/webhooks/foo then I need to reroute the traffic to the load balancer url https://ilb.url.com/api/mynew/test/foo. So the path suffix /foo I need to add allong with the load balancer path /api/mynew/test.
I tried with a AssignMessage policy but didn't worked
<AssignMessage async="false" continueOnError="false" enabled="true" name="RewriteWebhookTargetPath">
<DisplayName>Rewrite Webhook Target Path</DisplayName>
<Properties/>
<Set>
<Path>/api/mynew/test{request.pathsuffix}</Path>
</Set>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>
I could see the target url is wrongly forwarded to https://ilb.url.com/foo
Also the load balancer is defined in target connection tag.
Target URL is not enough. In my case, I need point to target connection
<HTTPTargetConnection>
<LoadBalancer>
<Server name="httpbin-test-ue1"/>
</Server>
</LoadBalancer>
<Path>/</Path>
</HTTPTargetConnection>
Example code
Hello,
Is there any specific reason why you aren't dynamically setting the path variable as a part of your HTTPTargetConnection element declaration? Something as follows should work to expectation given your use case:
Assign Message Policy (set in the Proxy request):
Target endpoint HTTPConnection:
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |