Hi Dilshan,
Stat publisher component is written in Java, and there will be APIs to
publish each event to BAM. With current implementation of EMM, Jaggery will
call these APIs when it is necessary to publish data. And this call will
happen in a separate thread[1] and inside java publishing component also,
we are using AsyncDataPublisher. Is this what you meant by
asynchronously? Regarding which
point should call to publish data; Issue in calling at API level is we have
complex Json payloads coming from devices and also when we are responding.
These things have to be parsed twice if we do at the API level. Also iOS
doesn't go through API manager. We can do it in the driver.js where all the
DB requests come, Is this a valid approach? True, doing this at function
level will involves a lot of changes.

[1] [DEV][Jaggery] Calling a Java method asynchronously from Jaggery

Regards,
Inosh

On Thu, Sep 18, 2014 at 3:04 AM, Dilshan Edirisuriya <dils...@wso2.com>
wrote:

> Hi Inosh,
>
> With the proposed refactoring discussions there is a high chance that most
> of the existing code get migrated to components. Hence is it possible to
> move this stat publisher logic into Java components and call them through
> API layer or some other generic point rather than adding them in actual
> functions. Also why not we focus on getting them done asynchronously where
> possible?
>
> Regards,
>
> Dilshan
>
> On Tue, Sep 16, 2014 at 9:00 PM, Inosh Perera <ino...@wso2.com> wrote:
>
>> Hi Maninda/Gihan,
>> Based on the offline discussions we had, your suggestions here seems to
>> be the ideal solution for our scenario. Since the payloads coming to EMM
>> have complex Json objects, writing a custom valve and extracting data
>> doesn't seem like a good option. We will have to extract data at
>> application level. In a situation like this, I can think of 2 places, where
>> we can publish data when it comes to EMM.  Lets say if you are inserting
>> some record to the EMM database that we need to send to BAM as well, in
>> this case, we can find the function that is sending the db request (for
>> example register new user function) or there is a class in EMM that handles
>> all the db request, something like a db object, which place seem like the
>> ideal place to collect data? In my opinion, publishing data has to be done
>> in each function.
>>
>> Regards,
>> Inosh
>>
>> On Tue, Sep 16, 2014 at 4:53 PM, Maninda Edirisooriya <mani...@wso2.com>
>> wrote:
>>
>>> Hi Inosh,
>>>
>>> And you need to extract parameter fields in the Application level and
>>> note that these field set should be fixed for all the events. You can send
>>> custom key-value pairs as well inside a separate string map . (Refer
>>> https://docs.wso2.com/display/BAM241/Data+Publisher)
>>>
>>> Thanks.
>>>
>>>
>>> *Maninda Edirisooriya*
>>> Senior Software Engineer
>>>
>>> *WSO2, Inc.*lean.enterprise.middleware.
>>>
>>> *Blog* : http://maninda.blogspot.com/
>>> *E-mail* : mani...@wso2.com
>>> *Skype* : @manindae
>>> *Twitter* : @maninda
>>>
>>> On Mon, Sep 15, 2014 at 6:43 PM, Gihan Anuruddha <gi...@wso2.com> wrote:
>>>
>>>> Hi Inosh,
>>>>
>>>> Yes, this is correct. You can use data agent that installs in EMM to
>>>> send captured data to BAM. For this you need to implement thrift based
>>>> client. Also, you can use the  HTTP event adaptor that comes with BAM 2.5.0
>>>> to achieve this task. Still, we are preparing the final documents for this
>>>> feature. Meantime, you can refer CEP doc [1] and [2] for further
>>>> information.
>>>>
>>>> [1] - https://docs.wso2.com/display/CEP310/Input+HTTP+Event+Adaptor
>>>> [2] - https://docs.wso2.com/pages/viewpage.action?pageId=34605847
>>>>
>>>> Regards,
>>>> Gihan
>>>>
>>>> On Mon, Sep 15, 2014 at 1:25 PM, Inosh Perera <ino...@wso2.com> wrote:
>>>>
>>>>> Hi all, We are trying to integrate BAM with EMM to provide ability to
>>>>> analyse data coming from devices. Bellow is the initial architecture
>>>>> diagram.
>>>>>
>>>>> ​
>>>>>  According to the requirement we have, we need to read data that comes
>>>>> with the payload, not meta data. These data, come from devices as Json and
>>>>> since data needs to be read and parsed, it can be done at application
>>>>> level. So data come to EMM and parsed and published accordingly. Please
>>>>> inform me if this approach is correct.
>>>>>
>>>>> Regards,
>>>>> Inosh
>>>>>
>>>>> --
>>>>> Inosh Perera
>>>>> Software Engineer, WSO2 Inc.
>>>>> Tel: 0785293686
>>>>>
>>>>> _______________________________________________
>>>>> Architecture mailing list
>>>>> Architecture@wso2.org
>>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> W.G. Gihan Anuruddha
>>>> Senior Software Engineer | WSO2, Inc.
>>>> M: +94772272595
>>>>
>>>> _______________________________________________
>>>> Architecture mailing list
>>>> Architecture@wso2.org
>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>
>>>>
>>>
>>
>>
>> --
>> Inosh Perera
>> Software Engineer, WSO2 Inc.
>> Tel: 0785293686
>>
>> _______________________________________________
>> Architecture mailing list
>> Architecture@wso2.org
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
> Dilshan Edirisuriya
> Senior Software Engineer - WSO2
> Mob: + 94 777878905
> http://wso2.com/
>



-- 
Inosh Perera
Software Engineer, WSO2 Inc.
Tel: 0785293686
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to