Noted Isuru,
will send a PR with unit tests I've written for one part involving address
endpoints in RecipientList endpoints and then move to the next parameter.

Thanks!




On Sun, Mar 19, 2023 at 1:19 PM Isuru Udana <isud...@gmail.com> wrote:

> Hi Nuwan,
>
> On Fri, Mar 10, 2023 at 6:37 PM Nuwan Jayawardene <nsga...@gmail.com>
> wrote:
>
>> Hi all,
>> I'm currently working on the $subject and ran into a blocker while
>> tackling serialization with injected environmental variables.
>>
>> In earlier applications of parameter injection (eg: WSDLEndpoint,
>> AddressEndpoint) how I achieved injection is by modifying a particular
>> setter method in the respective endpoint to ingest an environment variable
>> value while preserving the original variable name. Latter was done to
>> make serialization possible.
>> An example is included herewith:
>>
>> [image: Selection_558.png]
>>
>> While working on RecipientList endpoints I've identified 2 parameters
>> that are candidates for injection; httpPort and httpsPort.
>> The XML value extraction happens in the factory in the method linked
>> herewith:
>>
>> https://github.com/apache/synapse/blob/610baef00b1824d7d1341491ecc7f7d9b15485d3/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/RecipientListEndpointFactory.java#L147
>>
>> The issue I'm facing is that the extracted parameters are populating a
>> class named *Member* which is provided by Axios2 which I cannot edit.
>> While performing the injection in the factory works for deserialization,
>> it doesn't work for serialization, which requires preserving the original
>> environmental variable name, ideally in the Member class.
>>
>> I suppose extending Member and creating a new class for this purpose is a
>> solution, however, I'm unsure if that would have cascading issues with
>> other components of Synapse.
>> Looking forward to hearing your feedback on this as well as alternative
>> solutions.
>>
> I think we should skip this part. It's too complicated and not many people
> are using this feature.
>
>>
>> Best
>>
>> --
>> *Nuwan Jayawardene*
>> https://www.linkedin.com/m/in/nuwanjaya
>>
>>
>>
>
> --
> *Isuru Udana*
> Director - Engineering
> WSO2 Inc.; http://wso2.com
> Member, Apache Software Foundation; http://www.apache.org
>
> *email: isud...@gmail.com <isud...@gmail.com>* cell: +94 77 3791887
>
>

-- 
*Nuwan Jayawardene*
https://www.linkedin.com/m/in/nuwanjaya

Reply via email to