[prev in list] [next in list] [prev in thread] [next in thread] 

List:       synapse-dev
Subject:    Re: Blocker while adding parameter injection to RecipientList endpoint members
From:       Nuwan Jayawardene <nsgaj12 () gmail ! com>
Date:       2023-03-20 14:49:09
Message-ID: CAB+BoriF20U5YXjZeOtwMsU9EAk77soPD2hEEgrk5-+VjWQq-g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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 <nsgaj12@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 <isudana@gmail.com> wrote:
> 
> > Hi Nuwan,
> > 
> > On Fri, Mar 10, 2023 at 6:37 PM Nuwan Jayawardene <nsgaj12@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 <isudana@gmail.com>* cell: +94 77 3791887
> > 
> > 
> 
> --
> *Nuwan Jayawardene*
> https://www.linkedin.com/m/in/nuwanjaya
> 
> 

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


[Attachment #5 (text/html)]

<div dir="ltr"><div dir="ltr">Hi Isuru,<div>PR with the unit tests is linked \
herewith:  <a href="https://github.com/apache/synapse/pull/81">https://github.com/apache/synapse/pull/81</a></div><div><br></div><div>Kind \
regards<br><br><br><br></div></div><br><img width="0" height="0" \
class="mailtrack-img" alt="" style="display:flex" \
src="https://mailtrack.io/trace/mail/c9516592b093de169f7343c3ef92042b7a617b3a.png?u=1990004"><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 19, 2023 at \
4:16 PM Nuwan Jayawardene &lt;<a \
href="mailto:nsgaj12@gmail.com">nsgaj12@gmail.com</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Noted \
Isuru,<div>will send a PR with unit tests I&#39;ve written for one part involving \
address endpoints in  RecipientList endpoints and then move to the next \
parameter.</div><div><br></div><div>Thanks!<br><br><br><br></div></div><br><img \
width="0" height="0" alt="" style="display: flex;" \
src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 19, 2023 at \
1:19 PM Isuru Udana &lt;<a href="mailto:isudana@gmail.com" \
target="_blank">isudana@gmail.com</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi \
Nuwan,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, \
Mar 10, 2023 at 6:37 PM Nuwan Jayawardene &lt;<a href="mailto:nsgaj12@gmail.com" \
target="_blank">nsgaj12@gmail.com</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi all,<div>I&#39;m currently \
working on the $subject and ran into a blocker while tackling serialization with \
injected environmental variables.</div><div><br></div><div>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.</div><div>An example  is included \
herewith:</div><div><br></div><div><img src="cid:ii_lf2j8ldr1" \
alt="Selection_558.png" width="587" height="89" style="margin-right: \
0px;"><br><div><br></div><div>While working  on  RecipientList endpoints I&#39;ve \
identified 2 parameters that are candidates for injection; <font \
face="monospace">httpPort</font> and <font \
face="monospace">httpsPort</font>.</div><div>The XML value extraction happens in the \
factory in the method linked herewith:  </div><div><a \
href="https://github.com/apache/synapse/blob/610baef00b1824d7d1341491ecc7f7d9b15485d3/ \
modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/RecipientListEndpointFactory.java#L147" \
target="_blank">https://github.com/apache/synapse/blob/610baef00b1824d7d1341491ecc7f7d \
9b15485d3/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/RecipientListEndpointFactory.java#L147</a><br></div><div><br></div><div>The \
issue I&#39;m facing is that the extracted parameters are populating a class named \
<b><font face="monospace">Member</font></b> which is provided by Axios2 which I \
cannot edit.</div><div>While performing the injection in the factory works for \
deserialization, it doesn&#39;t work for serialization, which requires preserving the \
original environmental variable name,  ideally in the Member \
class.</div><div><br></div><div>I suppose extending Member and creating a new class \
for this purpose is a solution, however, I&#39;m unsure if that would have cascading \
issues with other components of Synapse.</div><div>Looking forward to hearing your \
feedback on this as well as alternative \
solutions.</div></div></div></blockquote><div>I think we should skip this part. \
It&#39;s too complicated and not many people are using this feature.  \
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px \
solid rgb(204,204,204);padding-left:1ex"><div \
dir="ltr"><div><div><br></div><div>Best</div><div><br></div><span>-- </span><br><div \
dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div \
dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><b>Nuwan \
Jayawardene</b></div><div dir="ltr"><div><font size="1"><a \
href="https://www.linkedin.com/m/in/nuwanjaya" \
target="_blank">https://www.linkedin.com/m/in/nuwanjaya</a><br></font></div><div \
style="font-size:small;letter-spacing:normal"><div style="margin:0px;padding:0px 0px \
20px;width:1014px;font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:medium"><div><div \
style="font-size:12.8px;margin:8px 0px 0px;padding:0px"><div><div dir="ltr"><div \
dir="ltr"><span><font \
color="#888888"><br></font></span></div></div><div></div></div></div><div></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div><img \
width="0" height="0" alt="" style="display: flex;" \
src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"></div>
 </blockquote></div><br clear="all"><div><br></div><span>-- </span><br><div \
dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div \
dir="ltr"><div><div dir="ltr"><font color="#888888"><b \
style="color:rgb(102,102,102)">Isuru Udana</b></font></div><div dir="ltr"><span \
style="color:rgb(136,136,136);font-size:13px"><div dir="ltr">Director - \
Engineering</div></span><font color="#888888"><span style="font-size:13px"><div \
dir="ltr"><span style="font-size:small">WSO2 Inc.;  </span><a href="http://wso2.com/" \
style="font-size:small" \
target="_blank">http://wso2.com</a><br></div></span><div>Member, Apache Software \
Foundation;  <a href="http://www.apache.org/" style="color:rgb(17,85,204)" \
target="_blank">http://www.apache.org</a><br></div><div><div \
style="display:inline"><font color="#888888"><br></font></div></div></font><font \
color="#888888"><div><div style="display:inline"><b style="color:rgb(32,33,36)"><div \
style="display:inline"><font color="#888888" style="font-weight:normal">email:  <a \
href="mailto:isudana@gmail.com" \
target="_blank">isudana@gmail.com</a></font></div></b><font color="#888888">  cell: \
+94 77 3791887</font></div></div></font></div></div><div><br></div></div></div></div></div></div></div></div>
 </blockquote></div><br clear="all"><div><br></div><span>-- </span><br><div \
dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div \
dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><b>Nuwan \
Jayawardene</b></div><div dir="ltr"><div><font size="1"><a \
href="https://www.linkedin.com/m/in/nuwanjaya" \
target="_blank">https://www.linkedin.com/m/in/nuwanjaya</a><br></font></div><div \
style="font-size:small;letter-spacing:normal"><div style="margin:0px;padding:0px 0px \
20px;width:1014px;font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:medium"><div><div \
style="font-size:12.8px;margin:8px 0px 0px;padding:0px"><div><div dir="ltr"><div \
dir="ltr"><span><font \
color="#888888"><br></font></span></div></div><div></div></div></div><div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
 </blockquote></div><br clear="all"><div><br></div><span \
class="gmail_signature_prefix">-- </span><br><div dir="ltr" \
class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div \
dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><b>Nuwan \
Jayawardene</b></div><div dir="ltr"><div><font size="1"><a \
href="https://www.linkedin.com/m/in/nuwanjaya" \
target="_blank">https://www.linkedin.com/m/in/nuwanjaya</a><br></font></div><div \
style="font-size:small;letter-spacing:normal"><div style="margin:0px;padding:0px 0px \
20px;width:1014px;font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:medium"><div><div \
style="font-size:12.8px;margin:8px 0px 0px;padding:0px"><div><div dir="ltr"><div \
dir="ltr"><span><font \
color="#888888"><br></font></span></div></div><div></div></div></div><div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>


--00000000000076569105f75608dd--


["Selection_558.png" (image/png)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic