You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Nuwan Jayawardene <ns...@gmail.com> on 2023/03/10 13:06:27 UTC
Blocker while adding parameter injection to RecipientList endpoint members
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.
Best
--
*Nuwan Jayawardene*
https://www.linkedin.com/m/in/nuwanjaya
Re: Blocker while adding parameter injection to RecipientList endpoint members
Posted by Nuwan Jayawardene <ns...@gmail.com>.
Hi Isuru,
PR with the unit tests is linked herewith:
https://github.com/apache/synapse/pull/81
Kind regards
On Sun, Mar 19, 2023 at 4:16 PM Nuwan Jayawardene <ns...@gmail.com> wrote:
> 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 <is...@gmail.com> wrote:
>
>> Hi Nuwan,
>>
>> On Fri, Mar 10, 2023 at 6:37 PM Nuwan Jayawardene <ns...@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: isudana@gmail.com <is...@gmail.com>* cell: +94 77 3791887
>>
>>
>
> --
> *Nuwan Jayawardene*
> https://www.linkedin.com/m/in/nuwanjaya
>
>
--
*Nuwan Jayawardene*
https://www.linkedin.com/m/in/nuwanjaya
Re: Blocker while adding parameter injection to RecipientList endpoint members
Posted by Nuwan Jayawardene <ns...@gmail.com>.
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 <is...@gmail.com> wrote:
> Hi Nuwan,
>
> On Fri, Mar 10, 2023 at 6:37 PM Nuwan Jayawardene <ns...@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: isudana@gmail.com <is...@gmail.com>* cell: +94 77 3791887
>
>
--
*Nuwan Jayawardene*
https://www.linkedin.com/m/in/nuwanjaya
Re: Blocker while adding parameter injection to RecipientList endpoint members
Posted by Isuru Udana <is...@gmail.com>.
Hi Nuwan,
On Fri, Mar 10, 2023 at 6:37 PM Nuwan Jayawardene <ns...@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: isudana@gmail.com <is...@gmail.com>* cell: +94 77 3791887