Hi Srinath, Lakini,

Siddhi is thread safe when sending events. You can send events via multiple
threads without any issue.

When changing queries via multiple threads, the execution plan runtime of
the previous query would have to be shutdown manually. Looking at the
current code, it seems that an ExecutionPlanRuntime instance would be
created after the query is parsed and that would be put to a
ConcurrentHashMap with the execution plan name (specified via annotations)
as the key. So if you do not shutdown that old runtime, it will still keep
running. But if you shutdown the execution plan from the client code, you
should not encounter any issue. @Suho, please correct if my understanding
is incorrect on this.

@Lakini, if you are having two execution plans with different names and
still it seems that one query is overriding the other, that is wrong. Can
you share the execution plan syntax you are using for the two queries and
also point to the code? Based on the scenario described above, it seems
there is a conflict on the execution plan names or the output streams of
the execution plans.

Thanks,
Lasantha

On 25 August 2015 at 16:09, Srinath Perera <srin...@wso2.com> wrote:

> Please point to your code.
>
> CEP team, please help.
>
> On Tue, Aug 25, 2015 at 4:00 PM, Lakini Senanayaka <lak...@wso2.com>
> wrote:
>
>>  Srinath,thank you for your prompt reply.
>>
>> My Client and Service run separately in 2 different processes.I have just
>> developed 2 simple apps which send random data and I controlled it using a
>> timer.I have set 2 different rules for the 2 apps.one client has a rule
>> like notify when the value>50 and the second client has a rule like notify
>> when the value>20.When running two clients in the same time ,the first
>> client get notification for value>20,although it's rule is value>50.
>>
>> So the SiddhiManager has overrides the 1st client's query by second
>> client's query.
>>
>> On Tue, Aug 25, 2015 at 3:36 PM, Srinath Perera <srin...@wso2.com> wrote:
>>
>>> Suho is Siddhi engine thread safe
>>> 1. send events
>>> 2. to change queries.
>>>
>>> Lakini answer depends on above.
>>>
>>> Could u explain how two clients override the same query? are they
>>> running the same query?
>>>
>>> Thanks
>>> Srinath
>>>
>>> On Tue, Aug 25, 2015 at 3:24 PM, Lakini Senanayaka <lak...@wso2.com>
>>> wrote:
>>>
>>>> Hi Srinath,
>>>>
>>>> As an small introduction to my project,it is about EdgeAnalytics
>>>> Service which is an android service and it does edge analytic using Siddhi
>>>> queries. There are 2 types of clients for the service.I have developed Type
>>>> 1 client which sends it's own data to analyse with user define streams,rule
>>>> and a callback.I'm using AIDL interface method for the Client-Service
>>>> connection.
>>>>
>>>> I have a copy of working project now.In here I used a single thread to
>>>> develop service as you told me in the meeting ,where we discussed the
>>>> Architecture of Edge Analytic Service.But in my application when we are
>>>> running 2 or more  client apps in the same time the siddhimanager in the
>>>> service overrides the the 1st rule of the first running client with the
>>>> rule of second client.(in here rule mean the Logic)So for first client it
>>>> gives wrong results.So to overcome from that we have to use multi threading
>>>> and I discussed this issue with Shan and he told me that this problem can
>>>> be solve by using multi threading.So Could you please advice me how to
>>>> overcome this issue,although you told me not to use multithreading.
>>>> Suggestions would be appreciate.
>>>>
>>>> I have attached a documentation about Edge Analytic s Service.
>>>>
>>>>
>>>> Thank you.
>>>> --
>>>> *Intern-Engineering*
>>>> Lakini S.Senanayaka
>>>> Mobile: +94 712295444
>>>> Email: lak...@wso2.com
>>>>
>>>
>>>
>>>
>>> --
>>> ============================
>>> Blog: http://srinathsview.blogspot.com twitter:@srinath_perera
>>> Site: http://people.apache.org/~hemapani/
>>> Photos: http://www.flickr.com/photos/hemapani/
>>> Phone: 0772360902
>>>
>>
>>
>>
>> --
>> *Intern-Engineering*
>> Lakini S.Senanayaka
>> Mobile: +94 712295444
>> Email: lak...@wso2.com
>>
>
>
>
> --
> ============================
> Blog: http://srinathsview.blogspot.com twitter:@srinath_perera
> Site: http://people.apache.org/~hemapani/
> Photos: http://www.flickr.com/photos/hemapani/
> Phone: 0772360902
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Lasantha Fernando*
Senior Software Engineer - Data Technologies Team
WSO2 Inc. http://wso2.com

email: lasan...@wso2.com
mobile: (+94) 71 5247551
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to