Hi all,

I added the following text as a tip in [1]. Please let me know whether it
is correct.


When you use the tryPublish API, it is important to check the value it
returns. If it returns false (i.e indicating that the event was not
sent), you should slow down the process of sending it requests in order to
avoid overusing the CPU resources and blocking them for other operations.
In order to do this, use the sleep option or similar.

[1] https://docs.wso2.com/pages/viewpage.action?pageId=48288495

Best Regards,
Rukshani.

On Tue, Jun 21, 2016 at 10:42 PM, Sriskandarajah Suhothayan <s...@wso2.com>
wrote:

> Using the blocking method will handle this case, we introduced tryPublish
> so that we can fire and forget or else we can write to logs if we can't
> send events. Yes in these cases sometimes we have to check the retune value
> and modify the processing accordingly.
>
> Regards
> Suho
>
> On Tue, Jun 21, 2016 at 5:59 AM, Nirmal Fernando <nir...@wso2.com> wrote:
>
>> Hi All,
>>
>> While doing a performance test using a data publisher client, it was
>> realized that it's important to check the returned value of tryPublish API
>> and if it is false (i.e. if the event wasn't sent) Clients' should slow
>> down a bit (use a sleep or similar)  to avoid spinning the CPU.
>>
>> Please note this especially when you write a data publisher client to do
>> a migration, a performance test etc.
>>
>> We need to add a note in
>> https://docs.wso2.com/pages/viewpage.action?pageId=48288495#PublishingDataUsingJavaClientThroughThrift/Binary-Datapublishersample
>> too IMO.
>>
>> --
>>
>> Thanks & regards,
>> Nirmal
>>
>> Team Lead - WSO2 Machine Learner
>> Associate Technical Lead - Data Technologies Team, WSO2 Inc.
>> Mobile: +94715779733
>> Blog: http://nirmalfdo.blogspot.com/
>>
>>
>>
>
>
> --
>
> *S. Suhothayan*
> Technical Lead & Team Lead of WSO2 Complex Event Processor
> *WSO2 Inc. *http://wso2.com
> * <http://wso2.com/>*
> lean . enterprise . middleware
>
>
> *cell: (+94) 779 756 757 <%28%2B94%29%20779%20756%20757> | blog:
> http://suhothayan.blogspot.com/ <http://suhothayan.blogspot.com/>twitter:
> http://twitter.com/suhothayan <http://twitter.com/suhothayan> | linked-in:
> http://lk.linkedin.com/in/suhothayan <http://lk.linkedin.com/in/suhothayan>*
>



-- 
Rukshani Weerasinha

WSO2 Inc.
Web:http://wso2.com
Mobile: 0777 683 738
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to