Re: [Dev] [GSoC 2017] Proposal 4: Idea Plugin for Siddhi

2017-03-26 Thread Tishan Dahanayakage
Hi Menuka,

Great progress Menuka. Can you please explain how did you achieve this and
resources used.
How can we try this plugin? Can you please provide the required resources?

Thanks,
/Tishan

On Mon, Mar 27, 2017 at 12:42 AM, Menuka Warushavithana <
menuka...@cse.mrt.ac.lk> wrote:

> Hi Tishan,
> I was able to implement a simple syntax highlighting plugin for Siddhi
> queries with the help of [1] and Antlr. (A screenshot is attached herewith)
>
> ​
> I set up the WSO2 CEP locally and started studying Siddhi in more detail.
> Also, I have started drafting a proposal for the project. Your advice and
> constructive criticism on this idea is greatly appreciated.
>
> [1] https://github.com/wso2/siddhi/blob/master/modules/
> siddhi-query-compiler/src/main/antlr4/org/wso2/siddhi/
> query/compiler/SiddhiQL.g4
>
>
> Thank You
> --
> Menuka Warushavithana
> LinkedIn: https://www.linkedin.com/in/menukawarushavithana
> GitHub: https://www.github.com/menuka94
>



-- 
Tishan Dahanayakage
Senior Software Engineer
WSO2, Inc.
Mobile:+94 716481328

Disclaimer: This communication may contain privileged or other confidential
information and is intended exclusively for the addressee/s. If you are not
the intended recipient/s, or believe that you may have received this
communication in error, please reply to the sender indicating that fact and
delete the copy you received and in addition, you should not print, copy,
re-transmit, disseminate, or otherwise use the information contained in
this communication. Internet communications cannot be guaranteed to be
timely, secure, error or virus-free. The sender does not accept liability
for any errors or omissions.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [VOTE] Release WSO2 MSF4J 2.2.0 RC3

2017-03-26 Thread Eranda Rajapakshe
Tested the feature, microservice hot deployment in server mode.

[x] Stable - go ahead and release

Thanks,

On Sat, Mar 25, 2017 at 8:23 AM, Danesh Kuruppu  wrote:

> Hi Devs,
>
> This is the 3rd Release Candidate of WSO2 MSF4J(Microservices Framework
> for Java) 2.2.0.
>
> Please download, test the framework and vote. The vote will be open for
> 72 hours or as needed.
> Refer to GitHub readmes for guides.
>
> * Source and binary distribution files:*
> https://github.com/wso2/msf4j/releases/tag/v2.2.0-rc3
>
> *Maven staging repository:*
> https://maven.wso2.org/nexus/content/repositories/orgwso2msf4j-1017
>
> *The tag to be voted upon:*
> https://github.com/wso2/msf4j/tree/v2.2.0-rc3
>
>
> [ ] Broken - do not release (explain why)
> [ ] Stable - go ahead and release
>
> Thank you,
> Platform Team
>
> --
>
> *Danesh Kuruppu*
> Senior Software Engineer | WSO2
>
> Email: dan...@wso2.com
> Mobile: +94 (77) 1690552 <+94%2077%20169%200552>
> Web: WSO2 Inc 
>
>


-- 
*Eranda Rajapakshe*
Software Engineer
WSO2 Inc.
Mobile : +94784822608
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Idea Plugin for Siddhi

2017-03-26 Thread Udeshika Sewwandi
Hi Shan,
Thank you very much for your help. I already had gone through it and it was
helpful for me since I am new to Antlr.

Best Regards,
-Sewwandi

On 27 March 2017 at 10:22, Shan Mahanama  wrote:

> Hi Udeshika,
>
> Unfortunately, I haven't came across such a plugin for Eclipse. But I
> found a blog [1] which I think would help you.
>
> [1] http://www.theendian.com/blog/antlr-4-lexer-parser-and-
> listener-with-example-grammar/
>
> Thanks,
> Shan.
>
> On Sat, Mar 25, 2017 at 10:41 PM, Udeshika Sewwandi <
> sewwandikaus...@cse.mrt.ac.lk> wrote:
>
>> Hi,
>> Can you provide a a reference for Eclipse plugin environment also ?
>> Because I couldn't find a better reference to map antlr with Eclipse
>> environment. Although I know the path to follow in syntax highlighting in
>> Eclipse I couldn't map Antlr with it. Thank you.
>>
>> Best Regards,
>> -Sewwandi
>>
>>
>> On 25 March 2017 at 13:33, Shan Mahanama  wrote:
>>
>>> Hi Dulaj,
>>>
>>> You can use ANTLR parser without any issue in intellij plugin
>>> development. Please refer to the jetbrains [1] plugin by ANTLR authors.
>>>
>>> [1] https://github.com/antlr/jetbrains
>>>
>>> Thanks,
>>> Shan.
>>>
>>> On Sat, Mar 25, 2017 at 1:21 PM, Dulaj Atapattu <
>>> dulaj.r.atapa...@gmail.com> wrote:
>>>
 Hi Suho and Tishan,

 I am still working on integrating ANTLR parser with IntelliJ. But this
 post
 
  from
 antlr creator makes me suspicious on the feasibility of what I am trying to
 do. Any idea?

 Thank you.

 On Fri, Mar 24, 2017 at 2:24 PM, Tishan Dahanayakage 
 wrote:

> HI Dulaj,
>
> Siddhi is based on Antlr. So it will be better if you can try with
> that.
>
> /Tishan
>
> On Fri, Mar 24, 2017 at 12:08 PM, Dulaj Atapattu <
> dulaj.r.atapa...@gmail.com> wrote:
>
>> Hi Suho,
>>
>> Is it okay to use JFlex instead of ANTLR? IntelliJ Documentation is
>> on JFlex.
>>
>> On 23 Mar 2017 7:37 a.m., "Dulaj Atapattu" <
>> dulaj.r.atapa...@gmail.com> wrote:
>>
>>> Hi Suho,
>>>
>>> Ok sure. I will send a prototype to you ASAP.
>>>
>>> On 23 Mar 2017 1:44 a.m., "Sriskandarajah Suhothayan" 
>>> wrote:
>>>
 It would be good if you can implement a prototype of a text editor
 in idea for a simple grammar (prefarably in antler).

 Thanks
 Suho

 On Wed, Mar 22, 2017 at 11:56 PM, Dulaj Atapattu <
 dulaj.r.atapa...@gmail.com> wrote:

> Hi Suho,
>
> I am a final year Computer Science and Engineering Undergraduate
> of University of Moratuwa. I have some previous experience in 
> IntelliJ IDEA
> plugin development. I have developed a embedded graphical designer 
> for JSON
> files for IntelliJ IDEA. Therefore I would like to develop the Idea 
> Plugin
> for Siddhi as my GSOC project.
>
> I have already finished setting up the development environment
> with intellij-community source code. Now I am getting familiar with 
> ANTLR.
> I will soon start writing a proposal. Can you please mention what to 
> do in
> first as my next steps.
>
> Thank you.
>
> --
> *Dulaj Atapattu*
> Secretary | IEEE Computer Society
> Undergraduate | Department of Computer Science and Engineering
> University of Moratuwa
> Tel: +94712481879 <071%20248%201879>
> [image:
> https://twitter.com/DRAtapattu] 
> [image:
> https://www.facebook.com/dulaj.atapattu]
> 
>



 --

 *S. Suhothayan*
 Associate Director / Architect
 *WSO2 Inc. *http://wso2.com
 * *
 lean . enterprise . middleware


 *cell: (+94) 779 756 757 <077%20975%206757> | blog:
 http://suhothayan.blogspot.com/ 
 twitter:
 http://twitter.com/suhothayan  | 
 linked-in:
 http://lk.linkedin.com/in/suhothayan 
 *

>>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Tishan Dahanayakage
> Senior Software Engineer
> WSO2, Inc.
> Mobile:+94 716481328 <071%20648%201328>
>
> Disclaimer: This communication may contain privileged or other
> confidential information and is intended exclusively for the 

Re: [Dev] Idea Plugin for Siddhi

2017-03-26 Thread Shan Mahanama
Hi Udeshika,

Unfortunately, I haven't came across such a plugin for Eclipse. But I found
a blog [1] which I think would help you.

[1]
http://www.theendian.com/blog/antlr-4-lexer-parser-and-listener-with-example-grammar/

Thanks,
Shan.

On Sat, Mar 25, 2017 at 10:41 PM, Udeshika Sewwandi <
sewwandikaus...@cse.mrt.ac.lk> wrote:

> Hi,
> Can you provide a a reference for Eclipse plugin environment also ?
> Because I couldn't find a better reference to map antlr with Eclipse
> environment. Although I know the path to follow in syntax highlighting in
> Eclipse I couldn't map Antlr with it. Thank you.
>
> Best Regards,
> -Sewwandi
>
>
> On 25 March 2017 at 13:33, Shan Mahanama  wrote:
>
>> Hi Dulaj,
>>
>> You can use ANTLR parser without any issue in intellij plugin
>> development. Please refer to the jetbrains [1] plugin by ANTLR authors.
>>
>> [1] https://github.com/antlr/jetbrains
>>
>> Thanks,
>> Shan.
>>
>> On Sat, Mar 25, 2017 at 1:21 PM, Dulaj Atapattu <
>> dulaj.r.atapa...@gmail.com> wrote:
>>
>>> Hi Suho and Tishan,
>>>
>>> I am still working on integrating ANTLR parser with IntelliJ. But this
>>> post
>>> 
>>>  from
>>> antlr creator makes me suspicious on the feasibility of what I am trying to
>>> do. Any idea?
>>>
>>> Thank you.
>>>
>>> On Fri, Mar 24, 2017 at 2:24 PM, Tishan Dahanayakage 
>>> wrote:
>>>
 HI Dulaj,

 Siddhi is based on Antlr. So it will be better if you can try with
 that.

 /Tishan

 On Fri, Mar 24, 2017 at 12:08 PM, Dulaj Atapattu <
 dulaj.r.atapa...@gmail.com> wrote:

> Hi Suho,
>
> Is it okay to use JFlex instead of ANTLR? IntelliJ Documentation is on
> JFlex.
>
> On 23 Mar 2017 7:37 a.m., "Dulaj Atapattu" 
> wrote:
>
>> Hi Suho,
>>
>> Ok sure. I will send a prototype to you ASAP.
>>
>> On 23 Mar 2017 1:44 a.m., "Sriskandarajah Suhothayan" 
>> wrote:
>>
>>> It would be good if you can implement a prototype of a text editor
>>> in idea for a simple grammar (prefarably in antler).
>>>
>>> Thanks
>>> Suho
>>>
>>> On Wed, Mar 22, 2017 at 11:56 PM, Dulaj Atapattu <
>>> dulaj.r.atapa...@gmail.com> wrote:
>>>
 Hi Suho,

 I am a final year Computer Science and Engineering Undergraduate of
 University of Moratuwa. I have some previous experience in IntelliJ 
 IDEA
 plugin development. I have developed a embedded graphical designer for 
 JSON
 files for IntelliJ IDEA. Therefore I would like to develop the Idea 
 Plugin
 for Siddhi as my GSOC project.

 I have already finished setting up the development environment with
 intellij-community source code. Now I am getting familiar with ANTLR. I
 will soon start writing a proposal. Can you please mention what to do 
 in
 first as my next steps.

 Thank you.

 --
 *Dulaj Atapattu*
 Secretary | IEEE Computer Society
 Undergraduate | Department of Computer Science and Engineering
 University of Moratuwa
 Tel: +94712481879 <071%20248%201879>
 [image:
 https://twitter.com/DRAtapattu] [image:
 https://www.facebook.com/dulaj.atapattu]
 

>>>
>>>
>>>
>>> --
>>>
>>> *S. Suhothayan*
>>> Associate Director / Architect
>>> *WSO2 Inc. *http://wso2.com
>>> * *
>>> lean . enterprise . middleware
>>>
>>>
>>> *cell: (+94) 779 756 757 <077%20975%206757> | blog:
>>> http://suhothayan.blogspot.com/ 
>>> twitter:
>>> http://twitter.com/suhothayan  | 
>>> linked-in:
>>> http://lk.linkedin.com/in/suhothayan 
>>> *
>>>
>>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


 --
 Tishan Dahanayakage
 Senior Software Engineer
 WSO2, Inc.
 Mobile:+94 716481328 <071%20648%201328>

 Disclaimer: This communication may contain privileged or other
 confidential information and is intended exclusively for the addressee/s.
 If you are not the intended recipient/s, or believe that you may have
 received this communication in error, please reply to the sender indicating
 that fact and delete the copy you received and in addition, you should not
 print, copy, re-transmit, disseminate, or otherwise use the information
 contained in this communication. Internet communications cannot be
 guaranteed to

Re: [Dev] GSoC 2017 - JMeter Test Manager for Distributed Deployments of WSO2 Servers

2017-03-26 Thread Yasassri Ratnayake
Hi Thilina,

On Sun, Mar 26, 2017 at 4:07 AM, Thilina Manamgoda 
wrote:

> Hi Yasassri,
>
> Please find my comments inline.
>
> On Wed, Mar 22, 2017 at 8:12 PM, Yasassri Ratnayake 
> wrote:
>
>> Hi Thilina,
>>
>> We have missed some requirements. Please consider the following as well.
>>
>> 1. We need a Tomcat instance to host the Backends(Weapps) which are
>> required by the Test Scripts. So we need another instance spawned with
>> Tomcat. After spawning the instance you can deploy the prerequisite web
>> apps. (These web apps will be available in the Test-Repo under resources)
>>
>
>  Yes of course we can archieve this as well.
>
> 2. Also when deploying Jmeter we need to copy 3rd party Jars to Jmeter.
>> (These are also available in the repository)
>>
>
>
>> This can be done by copying these files to docker image in Jmeter docker
>> image building stage.
>>
>
>
>> Also answering your question about the Deployment profiles. We have
>> identified several components to make the scope manageable.
>>
>> *Products*
>> ESB | V4.9 & V5.0
>> APIM | V1.9 & V2.0
>>
>> *JDK*
>> JAVA | V1.7 & V1.8
>>
>> *DataBase*
>> MySQL
>>
>> *Third Party Servers*
>> Brokers | ActiveMQ 5.10 | WSO2 MB 3.1 (Only applicable when ESB is used)
>>
>> So a Sample Profile would be, *ESB 4.9 + JAVA 1.7 + MYSQL + ActiveMQ*.
>> For now, you can concentrate on the above components when determining a
>> deployment profile. But your solution should be scalable.
>>
>> Is this a profile described here:https://docs.wso2.com/dis
> play/KA100/Clustered+Deployment+of+WSO2+Products+on+Kubernetes . If it
> is, then do I need to configure the product with third party servers or
> it's already done and I only have to deploy selected profile's servers into
> kubernetes cluster. For example let's take the above profile, in order to
> run this delpoyment ESB should be configured with MYSQL and Active MQ API
> endpoints. Do i need to change the configuration files of ESB or it's
> already taken care of and deployment is done once i deploy Kubernetes
> artifacts under the selected profile.
>

Existing scripts doesn't allow us to configure thirdparty dependencies like
Message Brokers. So yes we need to change ESB configurations depending on
the Broker, you can refer [1
] for
ActiveMQ configurations.


>
> Is this a profile of ESB : https://github.com/wso2/kube
> rnetes-artifacts/tree/master/wso2esb ?
>

Yes this script supports two profiles, default ESB profile and worker
manager profile, but as mentioned we neeed to tweek these scripts to
support mesage brokers as well.


> Also can't we have a private docker registry to hold our deplyment's
> images instead of building docker images via the web app ?.
>
>>
>>
We can use a private registry to store the docker images but you need to
comeup with some scripts to Auomate the process in that case.


[1] - https://docs.wso2.com/display/ESB490/Configure+with+ActiveMQ
-- 
Yasassri Ratnayake
Senior Software Engineer - QA
WSO2 Inc ; http://wso2.com
lean.enterprise.middleware
*Mobile : +94715933168*
*Blogs : http://yasassriratnayake.blogspot.com
*
*http://wso2logs.blogspot.com *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] GSoC 2017 : Real-Time Machine Learning Toolkit for Siddhi

2017-03-26 Thread Upul Bandara
Please find answers inline:

The questions I have:

1) Are we going to implement one extension for every algorithms or an new
extension for each learning algorithms.
One extension for all algorithms (please looks at
https://github.com/wso2-extensions/siddhi-execution-math for an example)

2) Are we going to use the same extension for training and predicting by
adding a new parameter to select if it is a training or a prediction :

   For every algorithm, we will have two methods namely: fit (for training)
and predict, similar to Scikit-Learn API

Regarding the proposal :

1) Do I have to mention about the performance and accuracy evaluation
techniques, benchmark data sets that will be used, or is it enough to just
focus on the high level design of the proposed system.
 When it comes to performance, Please run your model against well-known
datasets and present your result.


Thanks,
Upul


On Sat, Mar 25, 2017 at 10:26 AM, Nadheesh Jihan 
wrote:

> Hi,
>
> I sent the link to my prototype for the project proposal-24. I was
> expecting some feedback from you. Your feedback will be valuable for me to
> understand the requirements and produce a better proposal.
>
> Link to the prototype - https://github.com/Nadheesh/
> siddhi-execution-streaming-ml
>
> As I said earlier, I'm very interested in this project, since it is
> aligned with my passion and skill set. Therefore, I want to do my best for
> this project. I hope you don't mind me in asking some further questions
> since I want to further improve my prototype.
>
> In my prototype, I use a Stream Processor. So far, I have implemented a
> single functions to train and predict using *Perceptrons*.
>
> *sml:pml( name_of_algorithm, label, feature1, feature2, feature3)*
>
> *name_of_algorithm* - Name of training algorithms. (For now only
> Perceptron)
> *label* - The attribute name which contains the label of data (For
> supervise algorithms)
> *feature1, feature2...* - Attribute names of features
>
> The extension update the *Perceptron* model per each event. I tried to
> keep my algorithm very simple since we need to perform the training process
> with a small latency(real-time). And just to illustrate the prediction
> procedure, this stream processor returns a prediction for every given
> training data event as well
> Since this is a prototype I did not implement both versions.To implement
> the prediction procedure we can use the same extension or an another
> extension. However, I think we will need to persist the models in order to
> implement the prediction separately.
>
> The questions I have:
>
> 1) Are we going to implement one extension for every algorithms or an new
> extension for each learning algorithms.
>
> 2) Are we going to use the same extension for training and predicting by
> adding a new parameter to select if it is a training or a prediction
>
> Regarding the proposal :
>
> 1) Do I have to mention about the performance and accuracy evaluation
> techniques, benchmark data sets that will be used, or is it enough to just
> focus on the high level design of the proposed system.
>
> Thank you.
>
> --
> Best regards,
> *Nadheesh Jihan*
> Undergraduate | Department of Computer Science and Engineering
> Faculty of Engineering
> University of Moratuwa
>



-- 
Upul Bandara,
Associate Technical Lead, WSO2, Inc.,
Mob: +94 715 468 345.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Adding a connector via command line

2017-03-26 Thread Maheeka Jayasuriya
Hi Aaron,

You can copy the connector zip file to
[ESB_HOME]/repository/deployment/server/synapse-libs/ folder. This will
deploy the connector to the server.

If you need to enable the connector, instead of using the UI or admin
services, you can create a file as attached (for Instagram) and copy it to
[ESB_HOME]/repository/deployment/server/synapse-configs/default/imports.
Make sure the file name is as {}.xml .

Thanks,

Maheeka Jayasuriya
Associate Technical Lead
Mobile : +9450661

On Mon, Mar 27, 2017 at 6:16 AM, Aaron Watkins <
aaron.watkins@integration.works> wrote:

> Hello,
>
>
>
> I’m currently working on setting up the WSO2 ESB via puppet. I’ve got the
> basic setup all working, but need to add the file connector.
>
>
>
> Is there a way to automate the installation of a connector? Specifically,
> I don’t want to use the GUI to upload the zip file, but want to be able to
> add the connector from the command line. I’ve seen the following web page:
> http://stackoverflow.com/questions/28946865/is-it-
> possible-to-manage-wso2-esb-connectors-in-commandline, but that doesn’t
> upload the zip or anything, so doesn’t appear to actually do anything.
>
>
>
> Is there a location we could put the file (eg. repository/components/lib)
> or similar before enabling?
>
>
>
> Any tips would be greatly appreciated
>
>
>
>
>
> Aaron Watkins
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>

http://ws.apache.org/ns/synapse";
name="instagram"
package="org.wso2.carbon.connector"
status="enabled"/>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Adding a connector via command line

2017-03-26 Thread Aaron Watkins
Hello,

I'm currently working on setting up the WSO2 ESB via puppet. I've got the basic 
setup all working, but need to add the file connector.

Is there a way to automate the installation of a connector? Specifically, I 
don't want to use the GUI to upload the zip file, but want to be able to add 
the connector from the command line. I've seen the following web page: 
http://stackoverflow.com/questions/28946865/is-it-possible-to-manage-wso2-esb-connectors-in-commandline,
 but that doesn't upload the zip or anything, so doesn't appear to actually do 
anything.

Is there a location we could put the file (eg. repository/components/lib) or 
similar before enabling?

Any tips would be greatly appreciated


Aaron Watkins
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [GSoC 2017] Proposal 4: Idea Plugin for Siddhi

2017-03-26 Thread Menuka Warushavithana
Hi Tishan,
I was able to implement a simple syntax highlighting plugin for Siddhi
queries with the help of [1] and Antlr. (A screenshot is attached herewith)

​
I set up the WSO2 CEP locally and started studying Siddhi in more detail.
Also, I have started drafting a proposal for the project. Your advice and
constructive criticism on this idea is greatly appreciated.

[1]
https://github.com/wso2/siddhi/blob/master/modules/siddhi-query-compiler/src/main/antlr4/org/wso2/siddhi/query/compiler/SiddhiQL.g4


Thank You
-- 
Menuka Warushavithana
LinkedIn: https://www.linkedin.com/in/menukawarushavithana
GitHub: https://www.github.com/menuka94
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Use char array as micro service parameter

2017-03-26 Thread Rasika Perera
Hi Denuwanthi and All,

When I do a POST request via, postman the special characters are rendered
> fine.
> Seems like this is happening with the ajax call

The reason for encoded payload is that when you perform jQuery $.ajax
default contentType is "application/x-www-form-urlencoded" which mean
jQuery will encode the content. However, you can specify different
contentType, then data will not encoded[1].

And in your code also noticed the following;

char[] passwordText = Charset.defaultCharset().decode(fullContent).array()


As per the FindBug report;

Reliance on default encoding Found a call to a method which will perform a
byte to String (or String to byte) conversion, and will assume that the
default platform encoding is suitable. This will cause the application
behaviour to vary between platforms. Use an alternative API and specify a
charset name or Charset object explicitly.


So please use a specific charset for instance;

char[] passwordText = StandardCharsets.UTF_8.decode(fullContent).array()

[1] http://stackoverflow.com/a/5264093/1560536

On Fri, Mar 24, 2017 at 5:02 PM, Denuwanthi De Silva 
wrote:

> Hi,
>
> As discussed offline I used the msf4j Reuest object in my microservice
>
> @POST
> @Path("/validatePassword")
> public Response isValidPassword(@Context Request password) {
>
> Then I tried retreving a char[] out of it as following
>
> ByteBuffer fullContent = BufferUtil.merge(password.getFullMessageBody());
> char[] passwordText = Charset.defaultCharset().decode(fullContent).array()
>
>
> But the returned contains different values for special characters.
>
> For example, the actual password I gave was ABCabc01*$*
> Then the value retreved in the microservice is ABCabc01
>
> *%24*
> Is there a way we can handle this?The password is sent from frontendside
> to backedn via an ajax call
>
> var password = $("#newPassword").val();
> $.ajax({
> type: "POST",
> url: 
> "/admin-portal/root/apis/passwordUtil-micro-service/validatePassword",
> data: {newPassword: password},
>
>
>
>
>
> Thanks
>
> On Thu, Mar 23, 2017 at 9:54 PM, Ayoma Wijethunga  wrote:
>
>> Hi Jude,
>>
>> I think you got me wrong. StringBuilder internally uses char[] to store
>> values (mutable sequence of characters [1] [2]). Therefore, we will not be
>> creating (and leaving behind) immutable String objects as long as we use
>> the StringBuilder properly.
>>
>> However, if you accidentally call a method such as
>> stringBuilder.toString() or stringBuilder.append(String str) you will end
>> up creating a immutable String in the memory. This is what I was trying to
>> imply with my sentence.
>>
>> We should not really depend on garbage collection for any data structure
>> storing passwords. If we are going to depend on GC for Arrays, there is no
>> point of *not* using String. Instead, since "char" is a mutable
>> primitive, it's possible to change the value to as desired (where as
>> Strings are immutable). Therefore, after storing password in a char[] or a
>> StringBuilder (which internally uses a char[]) you should clear the data,
>> before leaving the reference for GC to pickup, to make sure memory is
>> clean.
>>
>> However there is one issue associated with using StringBuilder for
>> password storage. StringBuilder has a mechanism used to grow the char[]
>> used internal, when such expansion is required
>> (AbstractStringBuilder.expandCapacity). This can leave behind arrays
>> that are not properly cleared in memory. This too can be addressed by
>> setting proper initialCapacity when creating StringBuilder.
>>
>> Anyhow, during offline discussion we identified that why Thusitha
>> suggested StringBuilder here was because, MSF4J by default
>> supports StringBuilder as a parameter type. However, with further checking
>> we identified that this StringBuilder is creating using Strings in MSF4J
>> level. Therefore, instead of going through the StringBuilder approach, we
>> will be directly using Byte stream of the request to ready passwords out
>> into char[] which is much clearer and does not introduce any immutable
>> Strings.
>>
>> [1] https://docs.oracle.com/javase/7/docs/api/java/lang/Stri
>> ngBuilder.html
>> [2] http://developer.classpath.org/doc/java/lang/StringBuild
>> er-source.html
>>
>> Best Regards,
>> Ayoma.
>>
>>
>> On Thu, Mar 23, 2017 at 9:19 PM, Jude Niroshan > > wrote:
>>
>>> We just need to avoid using any method that accepts or returns a String
 in StringBuilder, to avoid intermediate level Strings.
>>>
>>>
>>> ​I believe you are well aware about why the Strings and other sort of
>>> objects being discouraged to be used for passwords and other valuable
>>> information. It simply not to retain any information anywhere in heap or
>>> other intermediate volatile memory. Arrays can be quickly garbage collected
>>> and that valuable information can not be extracted again. ​
>>>
>>> http://stackoverflow.com/q/8881291/4506140
>>>
>>> Hope it helps :)
>>>
>>> Regards,
>>> Jude
>>>
>>>
>>> On Thu, Mar