Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

en/docs/design/api-policies/regular-gateway-policies/adding-default-endpoints.mdUpdate and rename adding-dynamic-endpoints.md to adding-default-endpo… #8369

Open
wants to merge 1 commit into
base: 4.2.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Adding Dynamic Endpoints
# Adding Default Endpoints

You cannot dynamically construct the back-end endpoint of an API using the address endpoints in the WSO2 API Manager. To achieve the requirement of a dynamic endpoint, you can use the default endpoint instead.
You cannot default construct the back-end endpoint of an API using the address endpoints in the WSO2 API Manager. To achieve the requirement of a default endpoint, you can use the default endpoint instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"To achieve the requirement of a default endpoint, you can use the default endpoint instead. " This does not make sense ?


[![Dynamic Endpoints]({{base_path}}/assets/img/learn/api-gateway/message-mediation/dynamic-endpoints.png)]({{base_path}}/assets/img/learn/api-gateway/message-mediation/dynamic-endpoints.png)
[![Default Endpoints]({{base_path}}/assets/img/learn/api-gateway/message-mediation/default-endpoints.png)]({{base_path}}/assets/img/learn/api-gateway/message-mediation/default-endpoints.png)

The default endpoint sends the message to the address specified in the **To** header. The **To** header can be constructed dynamically. An example is given below.
The default endpoint sends the message to the address specified in the **Obinna26/docs-apim** header. The **Obinna26/docs-apim** header can be constructed defaultly. An example is given below.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obinna26/docs-apim Please correct these entries


!!! example
``` xml
<sequence xmlns="http://ws.apache.org/ns/synapse" name="default-endpoint-seq">
<property name="service_ep" expression="fn:concat('http://jsonplaceholder.typicode.com/', 'posts/')"/>
<header name="To" expression="get-property('service_ep')"/>
<header name="Obinna26/docs-apim" expression="get-property('service_ep')"/>
</sequence>
```

In this example, you have constructed the `service_ep` property dynamically and assigned the value of this property to the **To** header. The default endpoint sends the message to the address specified in the **To** header, in this case,
In this example, you have constructed the `service_ep` property dynamically and assigned the value of this property to the **Obinna26/docs-apim** header. The default endpoint sends the message to the address specified in the **Obinna26/docs-apim** header, in this case,
`http://jsonplaceholder.typicode.com/posts/`.

!!! info
Expand All @@ -28,4 +28,4 @@ In this example, you have constructed the `service_ep` property dynamically and

You can copy the content of the above sequence to an XML file and upload it to an API configured with a dynamic endpoint using the Publisher Portal UI.

For more information, visit [Creating and Uploading Manually in API Publisher]({{base_path}}/learn/api-gateway/message-mediation/changing-the-default-mediation-flow-of-api-requests#creating-and-uploading-manually-in-api-publisher).
For more information, visit [Creating and Uploading Manually in API Publisher]({{base_path}}/learn/api-gateway/message-mediation/changing-the-default-mediation-flow-of-api-requests#creating-and-uploading-manually-in-api-publisher).