Events » History » Version 21

J. Wienke, 03/15/2012 07:00 PM

1 1 J. Moringen
h1. Events
2 1 J. Moringen
3 20 J. Moringen
{{>toc}}
4 20 J. Moringen
5 3 J. Moringen
Conceptually and when represented in programs, RSB Events consist of the following components:
6 3 J. Moringen
7 13 J. Moringen
|_.Name                  |_.Type                                                             |_.Comment                      |_.Required      |
8 13 J. Moringen
| sequence number        | 32-bit unsigned integer                                           | Assigned by informer          | yes            |
9 13 J. Moringen
| id                     | "UUID":http://en.wikipedia.org/wiki/Universally_unique_identifier | Unique Id of the event        | lazily derived |
10 13 J. Moringen
| [[Glossary|scope]]     | Scope object                                                      | Destination scope             | yes            |
11 18 J. Moringen
| [[Methods|method]]     | ASCII string                                                      | (see [[Methods]])             | no             |
12 13 J. Moringen
| [[Glossary|data-type]] |                                                                   | (see [[Glossary]], [[Types]]) | no?            |
13 13 J. Moringen
| [[Glossary|payload]]   | Domain-specific object                                            |                               | no             |
14 13 J. Moringen
| meta-data              | (see below)                                                       | (see below)                   | no             |
15 13 J. Moringen
16 13 J. Moringen
The id component of an event is derived from the sequence number of the event and the id of the participant that sent the event as follows:
17 13 J. Moringen
# Construct a string representation of the sequence number
18 13 J. Moringen
** Radix 16
19 17 J. Moringen
** Lower-case letters
20 13 J. Moringen
** Zero-padding to width 8
21 13 J. Moringen
# Use the UUID v.5 algorithm to construct the event id
22 13 J. Moringen
** namespace: id of the sending participant
23 13 J. Moringen
** name: the string constructed above
24 3 J. Moringen
25 15 J. Moringen
_Example/Test Cases:_
26 14 J. Moringen
<pre>
27 14 J. Moringen
sequence number        0
28 14 J. Moringen
sender id              D8FBFEF4-4EB0-4C89-9716-C425DED3C527
29 14 J. Moringen
30 14 J. Moringen
sequence number string "00000000"
31 14 J. Moringen
32 14 J. Moringen
event id               v5-uuid(D8FBFEF4-4EB0-4C89-9716-C425DED3C527, "00000000")
33 1 J. Moringen
                       => 84F43861-433F-5253-AFBB-A613A5E04D71
34 15 J. Moringen
</pre>
35 15 J. Moringen
36 15 J. Moringen
<pre>
37 15 J. Moringen
sequence number        378
38 17 J. Moringen
sender id              BF948D47-618F-4B04-AAC5-0AB5A1A79267
39 15 J. Moringen
40 15 J. Moringen
sequence number string "0000017a"
41 15 J. Moringen
42 15 J. Moringen
event id               v5-uuid(BF948D47-618F-4B04-AAC5-0AB5A1A79267, "0000017a")
43 15 J. Moringen
                       => BD27BE7D-87DE-5336-BECA-44FC60DE46A0
44 14 J. Moringen
</pre>
45 14 J. Moringen
46 1 J. Moringen
h2. Meta Data
47 1 J. Moringen
48 9 J. Moringen
Events carry a set of meta data with themselves. Some meta data items are specified and processed by RSB while others are user-defined and not interpreted by RSB.
49 1 J. Moringen
50 19 J. Moringen
All timestamps are expressed in "Coordinated Universal Time (UTC)":http://en.wikipedia.org/wiki/Coordinated_Universal_Time and stored with microsecond precision (even if the clock source used by RSB cannot actually provide microsecond precision).
51 19 J. Moringen
52 2 J. Moringen
h3. RSB Meta Data Items
53 2 J. Moringen
54 2 J. Moringen
The current set of specified, required meta data items is given below:
55 2 J. Moringen
56 6 J. Moringen
* *senderId*: ID (a UUID) of the sending participant.
57 7 J. Moringen
* *createTime*: a time stamp that is automatically filled with the time the event instance was created by the language binding. This should usually reflect the time at which the notified condition most likely occurred in the sender. If event instances are reused, it has to be reset manually by the client.
58 1 J. Moringen
* *sendTime*: the time at which the generated notification for an event was sent on the bus (after serialization)
59 7 J. Moringen
* *receiveTime*: the time at which an event is received by listener in its encoded form
60 7 J. Moringen
* *deliverTime*: the time at which an event was decoded and will be dispatched to the client as soon as possible (set directly before passing it to the client handler)
61 2 J. Moringen
62 1 J. Moringen
h3. User-defined Meta Data Items
63 2 J. Moringen
64 1 J. Moringen
* *userTimes*: a set of key-value user-defined time-stamps
65 1 J. Moringen
* *userInfos*: a set of key-value user-defined options with string keys and values
66 1 J. Moringen
67 19 J. Moringen
*createTime* and *sendTime* and *userTimes* are computed using the clock source of the sending process, whereas  *receiveTime* and *deliverTime* are filled using the clock source of receiving participant's process.
68 12 J. Moringen
69 21 J. Wienke
h2. Cause Vector
70 21 J. Wienke
71 21 J. Wienke
Each event hast a set of causing EventIds (idea from Luckham, The Power of Events: An Introduction to Complex Event Processing in Distributed Enterprise Systems).
72 21 J. Wienke
The user who sends an Event needs to insert the respective EventIds manually if required.
73 21 J. Wienke
74 21 J. Wienke
Currently, no specification how these IDs shall be used exists, especially with respect to transitivity.
75 21 J. Wienke
76 12 J. Moringen
h2. Implementations
77 12 J. Moringen
78 12 J. Moringen
|_.Language   |_.File(s)                                                                      |
79 12 J. Moringen
| C++         | source:trunk/cpp/core/src/rsb/Event.h,source:trunk/cpp/core/src/rsb/Event.cpp |
80 12 J. Moringen
| Java        | source:trunk/java/core/src/rsb/Event.java                                     |
81 12 J. Moringen
| Python      | source:"trunk/python/core/rsb/__init__.py"                                    |
82 12 J. Moringen
| Common Lisp | source:trunk/cl/cl-rsb/src/event.lisp                                         |