Hi Kasun, Yes this timestamp is per event. However, the scenarios mentioned in the previous mail can safely use the event timestamp. Let me further explain.
The Application server publish an event to BAM per each received Http Request. Here the meaningful timestamp of the event is the request's received time to the AS. There are two ways we can send this timestamp to BAM now. *1st Way* Event e = new Event(); List<Object> payload = new ArrayList<Object>(); payload.add(System.currentTimeMillis()); e.setPayloadData(payload); Publisher.publish(e); In the above case, the e.setTimestamp is not called. so BAM will assign its received time to that field. and payload_timestamp will have the event's real occurred timestamp. *2nd Way* Event e = new Event(); e.setTimestamp(System.currentTimeMillis()); Publisher.publish(e); In this way, the timestamp field is set. So bam will record this timestamp as the event's timestamp. This timestamp is independent from the event sent time. So publisher can send this event after 1 hour without problem. Hope this is explaining Whats wrong here. On Sat, Jul 26, 2014 at 8:27 PM, Praneesha Chandrasiri <[email protected]> wrote: > Hi Chamil, > > Thanks for bringing this up! > > I will look into this. > > > On Sat, Jul 26, 2014 at 5:10 PM, Kasun Gajasinghe <[email protected]> wrote: > >> Hi, >> >> Is this time stamp set per event? If so, the timestamp might be useful >> since the event generation time and the event sent time can be different. >> This could especially be true when sending events as batch requests >> asynchronously >> >> On Saturday, July 26, 2014, Chamil Jeewantha <[email protected]> wrote: >> >>> Hi All, >>> >>> [1] explains the Timestamp field of an event clearly. >>> >>> "*TimeStamp* - This is a long value and this is optional. If the >>> TimeStamp value is omitted the server *it* expected to populate the >>> TimeStamp value with event arrival time at the backend server (CEP/BAM)" >>> >>> But I have seen the timestamp is added to the data streams as a separate >>> payload parameter in [2]. >>> >>> This problem can be seen in org.wso2.carbon.bam.webapp.stat.publisher, >>> org.wso2.carbon.bam.service.data.publisher (and may be a lot of other) >>> components. They are using timestamp as a payload parameter (see the >>> StreamDefinitionCreatorUtil class). >>> >>> AFAIK there is no explicit requirement to do this duplication for >>> Timestamp. >>> >>> Shall we change [2] accordingly because the people who follows will get >>> confused otherwise. >>> >>> For existing components, we can just ignore this problem. >>> For new developments, this should be avoided. >>> >>> WDYT? >>> >>> [1] >>> http://wso2.com/library/articles/2012/07/creating-custom-agents-publish-events-bamcep/ >>> [2] >>> https://docs.wso2.com/display/BAM230/Creating+Hive+Queries+to+Analyze+Data >>> >>> -- >>> K.D. Chamil Jeewantha >>> Associate Technical Lead >>> WSO2, Inc.; http://wso2.com >>> Mobile: +94716813892 >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "WSO2 Documentation" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/a/wso2.com/d/optout. >>> >> >> >> -- >> >> *Kasun Gajasinghe*Senior Software Engineer, WSO2 Inc. >> email: kasung AT spamfree wso2.com >> linked-in: http://lk.linkedin.com/in/gajasinghe >> blog: http://kasunbg.org >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "WSO2 Documentation" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/a/wso2.com/d/optout. >> > > > > -- > Thanks & Best Regards, > *Praneesha Chandrasiri* > *Technical Writer* > *WSO2 Inc. * > *Mobile: +(94) 718156888 <%2B%2894%29%20718156888>* > *E-mail: [email protected] <[email protected]>* > > -- K.D. Chamil Jeewantha Associate Technical Lead WSO2, Inc.; http://wso2.com Mobile: +94716813892
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
