Hi Amitha,
>
> I am evaluating WSO2 API Manager in order to use it in an application. I
> encountered with the following scenarios and could not find documentation
> on those.
>
>
> 1. Caching of request information - in a scenario of not wanting to
> send all the parameters to the back-end, caching those at the in-sequence
> mediation; once the back-end response is received, out-sequence mediation
> uses the cached data to build the response.
>
> You can set the relvant properties to the message context within the
in-sequence you want to use in the outsequence. Following is an example of
setting the values. Here the scope has been set as default(synapse) which
makes this property available in both in and out sequences.
Set the property:
<property name="TestProperty" value="TestValue"
scope="default" type="STRING">
>
>
> Read the property
<property name=”Read-Property-value”
expression=”get-property(‘Test-Property’)”/>
<property name=”Read-Property-value” expression=”$ctx:Test-Property”/>
> 1. One-to-many mapping from one in-sequence to many back-end APIs
>
> To me, this sounds like a dynamic endpoint[1]. You can achieve this via
in-sequence.
You can use default endpoint, which will send the request to the endpoint
in "To" header. You can create "To" header during the mediation. Following
is a example scenario.
<property name="service_ep"
expression="fn:concat('http://localhost:{port}/services/',
'Test')"/>
<header name="To" expression="get-property('service_ep')"/>
<send>
<endpoint>
<default/>
</endpoint>
</send>
[1] https://docs.wso2.com/display/AM250/Working+with+Endpoints
Thanks,
DinushaD
--
Dinusha Dissanayake
Software Engineer
WSO2 Inc
Mobile: +94712939439
<https://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev