Re: [Dev] [APIM][Docker] Problems in worker, manager node when changing admin username and password

2017-04-06 Thread Pubudu Gunatilaka
Hi Chamara,

We recently introduced rsync for the gateway nodes in docker-compose and I
think that change has introduced the user as root [1]. Yes, this is not
good for the deployment and it is always better use a non-sudo user. This
has to be fixed and thank you for pointing this out.

Suggested approach regarding the admin credential change is also acceptable
and please refer the official doc on password change [2]. You need to
change the jndi.properties file as well.

[1] -
https://github.com/wso2/docker-apim/blob/v2.1.0/docker-compose/pattern-3/gateway-manager/Dockerfile#L20
[2] -
https://docs.wso2.com/display/AM210/Maintaining+Logins+and+Passwords#MaintainingLoginsandPasswords-Changingthesuperadminpassword

Thank you!

On Wed, Apr 5, 2017 at 3:18 PM, Chamara Philips 
wrote:

> [Adding Sanjeewa]
>
> On Wed, Apr 5, 2017 at 3:17 PM, Chamara Philips 
> wrote:
>
>> Hi devs,
>>
>> I fixed (temporarily) this by changing the supervisord-gateway-manager/wo
>> rker.conf.
>> The reason is that init.sh script is running as root. But the file is
>> owned by wso2user and other users can't write to it.
>>
>> When changed the *user=root in *above conf files, it worked. But this is
>> not good for deployment.
>>
>> Any idea about the root cause of this?
>>
>> Apart from this, there were few issues which I fixed by changing the
>> docker file adding following lines under *USER root.*
>>
>> RUN chmod 755 /mnt/wso2-artifacts/bin
>> RUN chmod -R 755 /mnt/wso2-artifacts/repository
>>
>> Additionally, in the gateway manager, worker docker files had to add
>>
>> *RUN rm -r /mnt/wso2*
>>
>> If not this line [1]
>> ,
>> override the changes from wso2-artifacts.
>>
>> [1] https://github.com/wso2/dockerfiles/blob/master/common/
>> scripts/entrypoint.sh#L107
>>
>> Regards,
>>
>> On Wed, Apr 5, 2017 at 12:24 PM, Chamara Philips <
>> chcphilips@gmail.com> wrote:
>>
>>> Hi devs,
>>>
>>> When trying to deploy an APIM cluster with the pattern-3, the
>>> wso2server.sh in wso2-artifacts/bin of worker and manager nodes, are not
>>> copied to the container/wso2-apim/bin as expected. However other
>>> configurations in wso2-artifacts/repository are copied.
>>>
>>> Is there any known reason for that?
>>>
>>> Worker, Manager nodes are not started with the expected profiles due to
>>> this reason. In both nodes, *workerNode=false* and *profile is not
>>> assigned*.
>>>
>>>
>>> Additionally what is the preferred way of changing the admin username
>>> and password when following the pattern-3? At the moment I am using the
>>> following approach.
>>>
>>> In wso2server.sh =>
>>> added
>>>
>>> -Dwso2.admin.username="$WSO2_ADMIN_USERNAME" \
>>> -Dwso2.admin.password="$WSO2_ADMIN_PASSWORD" \
>>> to the JAVA_OPTS.
>>>
>>> Then in user-mgt.xml =>
>>>
>>> 
>>> ${wso2.admin.username}
>>> ${wso2.admin.password}
>>> 
>>>
>>> Then in the docker-compose, gave the environment variable for
>>> $WSO2_ADMIN_USERNAME, "$WSO2_ADMIN_PASSWORD. This works fine in the
>>> keymanager, publisher, store nodes. But not in worker, manager since the
>>> wso2server.sh doesn't get copied at all. I have added user-mgt.xml into
>>> wso2-artifacts/repository/conf. And they get copied as expected in
>>> worker and manager.
>>>
>>>
>>> Is this approach correct for changing the admin username, password in a
>>> cluster? Or is there any other way?
>>>
>>> Regards
>>> --
>>> --
>>> Hareendra Chamara Philips (BSc.Eng(Hons))
>>> Sysco acceleration,
>>> SyscoLabs(Pvt) Ltd
>>> Mobile : +94 (0) 767 184161 <94767184161>
>>>
>>
>>
>>
>> --
>> --
>> Hareendra Chamara Philips (BSc.Eng(Hons))
>> Sysco acceleration,
>> SyscoLabs(Pvt) Ltd
>> Mobile : +94 (0) 767 184161 <94767184161> | +65 (9) 425 2874 <6594252874>
>>
>
>
>
> --
> --
> Hareendra Chamara Philips (BSc.Eng(Hons))
> Sysco acceleration,
> SyscoLabs(Pvt) Ltd
> Mobile : +94 (0) 767 184161 <94767184161> | +65 (9) 425 2874 <6594252874>
>



-- 
*Pubudu Gunatilaka*
Committer and PMC Member - Apache Stratos
Software Engineer
WSO2, Inc.: http://wso2.com
mobile : +94774078049 <%2B94772207163>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Is there a hard and fast rule to chose java 8 streams over for loops

2017-04-06 Thread Tharika Madurapperuma
Hi Rajith,

IMO Java streams should not be used always as a practice. It is not a
silver bullet. There can be issues in performance in some cases as you have
pointed out.

One of the main advantage of using streams is when the logic of looping
is quite complex and involves different operations on collections together,
so that it can improve readability and understandability. But at the same
time it can result in new and subtle bugs if we are not careful enough [1].

 The performance aspect of streams vs loops depends on the type of the
collection and the situation they deal with. This performance difference
can sometimes be negligible. Hence we cannot completely go with one against
another.

 So IMHO we can consider using streams only when necessary based on our
requirement and use loops where it deserves.


[1]
https://blog.jooq.org/2014/06/13/java-8-friday-10-subtle-mistakes-when-using-the-streams-api/


Thanks,
Tharika.


On Thu, Mar 30, 2017 at 12:01 PM, Rajith Roshan  wrote:

> Hi all,
>
> Most of our C5 development have used java8 streams api frequently more
> than the for loops.
> But there are some research have done to compare the performance of
> streams api compared to for loops. They have shown that stream API is slow
> compared to for loops in many scenarios (even for parallel streams). [1][2]
>
> Is there any proper guidance to use which one over the other or are we
> using streams as a practice in C5 development
>
> [1] - https://blog.jooq.org/2015/12/08/3-reasons-why-you-
> shouldnt-replace-your-for-loops-by-stream-foreach/
> [2] - https://jaxenter.com/java-performance-tutorial-how-fast-
> are-the-java-8-streams-118830.html
>
> Thanks!
> Rajith
>
> --
> Rajith Roshan
> Software Engineer, WSO2 Inc.
> Mobile: +94-72-642-8350 <%2B94-71-554-8430>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Tharika Madurapperuma*
Software Engineer | WSO2, Inc.

Email : thar...@wso2.com
Mobile : +94777875624
Web : http://wso2.com


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


Re: [Dev] Is there a hard and fast rule to chose java 8 streams over for loops

2017-04-06 Thread Pumudu Ruhunage
Hi, IMO for less number of iterations/elements for loops are much
efficient, and when number gets higher both are performing with similar
efficiency. Advantage of parallel streams shows up when number of elements
increases and cost of each iteration increases.
Therefore, usage of streams/loops is highly dependent of the scenario and
can not suggest either without proper knowledge of the scenario, especially
for critical paths.

Regards,

On Thu, Apr 6, 2017 at 5:19 PM, Tharika Madurapperuma 
wrote:

> Hi Rajith,
>
> IMO Java streams should not be used always as a practice. It is not a
> silver bullet. There can be issues in performance in some cases as you have
> pointed out.
>
> One of the main advantage of using streams is when the logic of
> looping is quite complex and involves different operations on collections
> together, so that it can improve readability and understandability. But at
> the same time it can result in new and subtle bugs if we are not careful
> enough [1].
>
>  The performance aspect of streams vs loops depends on the type of the
> collection and the situation they deal with. This performance difference
> can sometimes be negligible. Hence we cannot completely go with one against
> another.
>
>  So IMHO we can consider using streams only when necessary based on
> our requirement and use loops where it deserves.
>
>
> [1] https://blog.jooq.org/2014/06/13/java-8-friday-10-subtle-
> mistakes-when-using-the-streams-api/
>
>
> Thanks,
> Tharika.
>
>
> On Thu, Mar 30, 2017 at 12:01 PM, Rajith Roshan  wrote:
>
>> Hi all,
>>
>> Most of our C5 development have used java8 streams api frequently more
>> than the for loops.
>> But there are some research have done to compare the performance of
>> streams api compared to for loops. They have shown that stream API is slow
>> compared to for loops in many scenarios (even for parallel streams). [1][2]
>>
>> Is there any proper guidance to use which one over the other or are we
>> using streams as a practice in C5 development
>>
>> [1] - https://blog.jooq.org/2015/12/08/3-reasons-why-you-shouldn
>> t-replace-your-for-loops-by-stream-foreach/
>> [2] - https://jaxenter.com/java-performance-tutorial-how-fast-ar
>> e-the-java-8-streams-118830.html
>>
>> Thanks!
>> Rajith
>>
>> --
>> Rajith Roshan
>> Software Engineer, WSO2 Inc.
>> Mobile: +94-72-642-8350 <%2B94-71-554-8430>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Tharika Madurapperuma*
> Software Engineer | WSO2, Inc.
>
> Email : thar...@wso2.com
> Mobile : +94777875624 <+94%2077%20787%205624>
> Web : http://wso2.com
>
> 
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Pumudu Ruhunage
Software Engineer | WSO2 Inc
M: +94 779 664493  | http://wso2.com

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


Re: [Dev] Is there a hard and fast rule to chose java 8 streams over for loops

2017-04-06 Thread Jude Niroshan
I agree with Tharika. It's more important to know that streams can be
considered when you need parallel processing done. Being said that, usage
has to be careful about the mutable operations. AFAIK, streams are good at
map reduction over the traditional for loops. It is more easy to manipulate
the collections. But it is not advisable to always go for streams.

On Thu, Apr 6, 2017 at 8:54 PM, Pumudu Ruhunage  wrote:

> Hi, IMO for less number of iterations/elements for loops are much
> efficient, and when number gets higher both are performing with similar
> efficiency. Advantage of parallel streams shows up when number of elements
> increases and cost of each iteration increases.
> Therefore, usage of streams/loops is highly dependent of the scenario and
> can not suggest either without proper knowledge of the scenario, especially
> for critical paths.
>
> Regards,
>
> On Thu, Apr 6, 2017 at 5:19 PM, Tharika Madurapperuma 
> wrote:
>
>> Hi Rajith,
>>
>> IMO Java streams should not be used always as a practice. It is not a
>> silver bullet. There can be issues in performance in some cases as you have
>> pointed out.
>>
>> One of the main advantage of using streams is when the logic of
>> looping is quite complex and involves different operations on collections
>> together, so that it can improve readability and understandability. But at
>> the same time it can result in new and subtle bugs if we are not careful
>> enough [1].
>>
>>  The performance aspect of streams vs loops depends on the type of
>> the collection and the situation they deal with. This performance
>> difference can sometimes be negligible. Hence we cannot completely go with
>> one against another.
>>
>>  So IMHO we can consider using streams only when necessary based on
>> our requirement and use loops where it deserves.
>>
>>
>> [1] https://blog.jooq.org/2014/06/13/java-8-friday-10-subtle-mis
>> takes-when-using-the-streams-api/
>>
>>
>> Thanks,
>> Tharika.
>>
>>
>> On Thu, Mar 30, 2017 at 12:01 PM, Rajith Roshan  wrote:
>>
>>> Hi all,
>>>
>>> Most of our C5 development have used java8 streams api frequently more
>>> than the for loops.
>>> But there are some research have done to compare the performance of
>>> streams api compared to for loops. They have shown that stream API is slow
>>> compared to for loops in many scenarios (even for parallel streams). [1][2]
>>>
>>> Is there any proper guidance to use which one over the other or are we
>>> using streams as a practice in C5 development
>>>
>>> [1] - https://blog.jooq.org/2015/12/08/3-reasons-why-you-shouldn
>>> t-replace-your-for-loops-by-stream-foreach/
>>> [2] - https://jaxenter.com/java-performance-tutorial-how-fast-ar
>>> e-the-java-8-streams-118830.html
>>>
>>> Thanks!
>>> Rajith
>>>
>>> --
>>> Rajith Roshan
>>> Software Engineer, WSO2 Inc.
>>> Mobile: +94-72-642-8350 <%2B94-71-554-8430>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Tharika Madurapperuma*
>> Software Engineer | WSO2, Inc.
>>
>> Email : thar...@wso2.com
>> Mobile : +94777875624 <+94%2077%20787%205624>
>> Web : http://wso2.com
>>
>> 
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Pumudu Ruhunage
> Software Engineer | WSO2 Inc
> M: +94 779 664493  | http://wso2.com
> 
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Writing a custom OAuth2 token generator/issuer for IS 5.3.0

2017-04-06 Thread Tharindu Edirisinghe
Hi Devs,

I need to implement my own OAuth2 token generator/issuer for IS 5.3.0.

For that I wrote a class extending
*org.wso2.carbon.identity.oauth2.token.OauthTokenIssuerImpl
*class and put the component into lib directory (non OSGI).

Then in identity.xml file, under  tag, I add the tag
** and engage my custom token generator/issuer
by adding the fully qualified class name as the value of the tag.

Using the playground2 sample, I got the entire flow to working where all
the methods I have overridden are hit properly.

However, I see the following INFO log.

*[2017-04-07 09:32:32,334]  INFO
{org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration} -  The
default OAuth token issuer will be used. No custom token generator is set.*

I went through the code in [1] and found that the reason for the log is
that there is no ** tag in identity.xml which I have
defined.

So my question is, are the tags *IdentityOAuthTokenGenerator *and
*OAuthTokenGenerator
*both serve the same purpose ? or what is the difference.

Also since I have got the flow to working, can I ignore the above info log
although I am using my own token issuer ?

[1]
https://github.com/wso2/carbon-identity/blob/master/components/oauth/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/config/OAuthServerConfiguration.java

Thanks,
TharinduE

-- 

Tharindu Edirisinghe
Senior Software Engineer | WSO2 Inc
Platform Security Team
Blog : http://tharindue.blogspot.com
mobile : +94 775181586
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Writing a custom OAuth2 token generator/issuer for IS 5.3.0

2017-04-06 Thread Pushpalanka Jayawardhana
Hi,

* *is the latest addition from the two options
which we should continue to use.
*IdentityOAuthTokenGenerator *seems to be introduced to resolve some
limitations in *OAuthTokenGenerator, *but not totally removed for
backward compatibility.

Anyway logs seems to be misleading and needs correction.

Thanks,

On Fri, Apr 7, 2017 at 9:50 AM, Tharindu Edirisinghe 
wrote:

> Hi Devs,
>
> I need to implement my own OAuth2 token generator/issuer for IS 5.3.0.
>
> For that I wrote a class extending 
> *org.wso2.carbon.identity.oauth2.token.OauthTokenIssuerImpl
> *class and put the component into lib directory (non OSGI).
>
> Then in identity.xml file, under  tag, I add the tag
> ** and engage my custom token
> generator/issuer by adding the fully qualified class name as the value of
> the tag.
>
> Using the playground2 sample, I got the entire flow to working where all
> the methods I have overridden are hit properly.
>
> However, I see the following INFO log.
>
> *[2017-04-07 09:32:32,334]  INFO
> {org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration} -  The
> default OAuth token issuer will be used. No custom token generator is set.*
>
> I went through the code in [1] and found that the reason for the log is
> that there is no ** tag in identity.xml which I have
> defined.
>
> So my question is, are the tags *IdentityOAuthTokenGenerator *and 
> *OAuthTokenGenerator
> *both serve the same purpose ? or what is the difference.
>
> Also since I have got the flow to working, can I ignore the above info log
> although I am using my own token issuer ?
>
> [1] https://github.com/wso2/carbon-identity/blob/master/
> components/oauth/org.wso2.carbon.identity.oauth/src/
> main/java/org/wso2/carbon/identity/oauth/config/
> OAuthServerConfiguration.java
>
> Thanks,
> TharinduE
>
> --
>
> Tharindu Edirisinghe
> Senior Software Engineer | WSO2 Inc
> Platform Security Team
> Blog : http://tharindue.blogspot.com
> mobile : +94 775181586 <077%20518%201586>
>



-- 
Pushpalanka.
-- 
Pushpalanka Jayawardhana, B.Sc.Eng.(Hons).
Senior Software Engineer, WSO2 Lanka (pvt) Ltd;  wso2.com/
Mobile: +94779716248
Blog: pushpalankajaya.blogspot.com/ | LinkedIn:
lk.linkedin.com/in/pushpalanka/ | Twitter: @pushpalanka
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Writing a custom OAuth2 token generator/issuer for IS 5.3.0

2017-04-06 Thread Tharindu Edirisinghe
Thanks Pushpalanka for looking into this.

I created the JIRA [1] to track this.

[1] https://wso2.org/jira/browse/IDENTITY-5855

On Fri, Apr 7, 2017 at 10:01 AM, Pushpalanka Jayawardhana 
wrote:

> Hi,
>
> * *is the latest addition from the two
> options which we should continue to use.
> *IdentityOAuthTokenGenerator *seems to be introduced to resolve some
> limitations in *OAuthTokenGenerator, *but not totally removed for
> backward compatibility.
>
> Anyway logs seems to be misleading and needs correction.
>
> Thanks,
>
> On Fri, Apr 7, 2017 at 9:50 AM, Tharindu Edirisinghe 
> wrote:
>
>> Hi Devs,
>>
>> I need to implement my own OAuth2 token generator/issuer for IS 5.3.0.
>>
>> For that I wrote a class extending 
>> *org.wso2.carbon.identity.oauth2.token.OauthTokenIssuerImpl
>> *class and put the component into lib directory (non OSGI).
>>
>> Then in identity.xml file, under  tag, I add the tag
>> ** and engage my custom token
>> generator/issuer by adding the fully qualified class name as the value of
>> the tag.
>>
>> Using the playground2 sample, I got the entire flow to working where all
>> the methods I have overridden are hit properly.
>>
>> However, I see the following INFO log.
>>
>> *[2017-04-07 09:32:32,334]  INFO
>> {org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration} -  The
>> default OAuth token issuer will be used. No custom token generator is set.*
>>
>> I went through the code in [1] and found that the reason for the log is
>> that there is no ** tag in identity.xml which I
>> have defined.
>>
>> So my question is, are the tags *IdentityOAuthTokenGenerator *and 
>> *OAuthTokenGenerator
>> *both serve the same purpose ? or what is the difference.
>>
>> Also since I have got the flow to working, can I ignore the above info
>> log although I am using my own token issuer ?
>>
>> [1] https://github.com/wso2/carbon-identity/blob/master/componen
>> ts/oauth/org.wso2.carbon.identity.oauth/src/main/java/
>> org/wso2/carbon/identity/oauth/config/OAuthServerConfiguration.java
>>
>> Thanks,
>> TharinduE
>>
>> --
>>
>> Tharindu Edirisinghe
>> Senior Software Engineer | WSO2 Inc
>> Platform Security Team
>> Blog : http://tharindue.blogspot.com
>> mobile : +94 775181586 <077%20518%201586>
>>
>
>
>
> --
> Pushpalanka.
> --
> Pushpalanka Jayawardhana, B.Sc.Eng.(Hons).
> Senior Software Engineer, WSO2 Lanka (pvt) Ltd;  wso2.com/
> Mobile: +94779716248
> Blog: pushpalankajaya.blogspot.com/ | LinkedIn: lk.linkedin.com/in/
> pushpalanka/ | Twitter: @pushpalanka
>
>


-- 

Tharindu Edirisinghe
Senior Software Engineer | WSO2 Inc
Platform Security Team
Blog : http://tharindue.blogspot.com
mobile : +94 775181586
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Is there a hard and fast rule to chose java 8 streams over for loops

2017-04-06 Thread Vidura Nanayakkara
Hi,

Blog [1]  compares streams
and loops for arrays and lists for different types of operations and is
worth taking a look at. Blog [2]

discusses
when to use parallel streams which are also worth taking a look. IMO this
depends according to the scenario you are left to deal with. For instance,
in Carbon UUF we use loops instead of streams since the datasets we
consider are relatively small (UUF is performance critical). There are also
instances where we use streams where the possible performance drop due to
using streams is small considering the code readability (the code is
complex when loops are used).

[1] Loops vs Streams 
[2] Parallel stream processing in Java 8 – performance of sequential vs.
parallel stream processing

[3] What's Wrong in Java 8, Part III: Streams and Parallel Streams


On Fri, Apr 7, 2017 at 9:02 AM, Jude Niroshan 
wrote:

> I agree with Tharika. It's more important to know that streams can be
> considered when you need parallel processing done. Being said that, usage
> has to be careful about the mutable operations. AFAIK, streams are good at
> map reduction over the traditional for loops. It is more easy to manipulate
> the collections. But it is not advisable to always go for streams.
>
> On Thu, Apr 6, 2017 at 8:54 PM, Pumudu Ruhunage  wrote:
>
>> Hi, IMO for less number of iterations/elements for loops are much
>> efficient, and when number gets higher both are performing with similar
>> efficiency. Advantage of parallel streams shows up when number of elements
>> increases and cost of each iteration increases.
>> Therefore, usage of streams/loops is highly dependent of the scenario and
>> can not suggest either without proper knowledge of the scenario, especially
>> for critical paths.
>>
>> Regards,
>>
>> On Thu, Apr 6, 2017 at 5:19 PM, Tharika Madurapperuma 
>> wrote:
>>
>>> Hi Rajith,
>>>
>>> IMO Java streams should not be used always as a practice. It is not
>>> a silver bullet. There can be issues in performance in some cases as you
>>> have pointed out.
>>>
>>> One of the main advantage of using streams is when the logic of
>>> looping is quite complex and involves different operations on collections
>>> together, so that it can improve readability and understandability. But at
>>> the same time it can result in new and subtle bugs if we are not careful
>>> enough [1].
>>>
>>>  The performance aspect of streams vs loops depends on the type of
>>> the collection and the situation they deal with. This performance
>>> difference can sometimes be negligible. Hence we cannot completely go with
>>> one against another.
>>>
>>>  So IMHO we can consider using streams only when necessary based on
>>> our requirement and use loops where it deserves.
>>>
>>>
>>> [1] https://blog.jooq.org/2014/06/13/java-8-friday-10-subtle-mis
>>> takes-when-using-the-streams-api/
>>>
>>>
>>> Thanks,
>>> Tharika.
>>>
>>>
>>> On Thu, Mar 30, 2017 at 12:01 PM, Rajith Roshan 
>>> wrote:
>>>
 Hi all,

 Most of our C5 development have used java8 streams api frequently more
 than the for loops.
 But there are some research have done to compare the performance of
 streams api compared to for loops. They have shown that stream API is slow
 compared to for loops in many scenarios (even for parallel streams). [1][2]

 Is there any proper guidance to use which one over the other or are we
 using streams as a practice in C5 development

 [1] - https://blog.jooq.org/2015/12/08/3-reasons-why-you-shouldn
 t-replace-your-for-loops-by-stream-foreach/
 [2] - https://jaxenter.com/java-performance-tutorial-how-fast-ar
 e-the-java-8-streams-118830.html

 Thanks!
 Rajith

 --
 Rajith Roshan
 Software Engineer, WSO2 Inc.
 Mobile: +94-72-642-8350 <%2B94-71-554-8430>

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


>>>
>>>
>>> --
>>> *Tharika Madurapperuma*
>>> Software Engineer | WSO2, Inc.
>>>
>>> Email : thar...@wso2.com
>>> Mobile : +94777875624 <+94%2077%20787%205624>
>>> Web : http://wso2.com
>>>
>>> 
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Pumudu Ruhunage
>> Software Engineer | WSO2 Inc
>> M: +94 779 664493  | http://wso2.com
>> 
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http