3 Replies Latest reply on Oct 24, 2012 6:15 AM by Junger He-Oracle

    BroadcastOutputAdapter: monotonic compound keys - possible?

    Daniel Amadei-Oracle
      I'm trying to architect my app to use BroadcastOutputAdapter.

      I'd like to use compound keys to be able to identify events based on timestamp and a custom property. I'm also trying to use monotonic approach as my key is based on a timestamp and have only a custom value to differentiate one from the other (like the accountId sample from the cep developer guide).

      However, when implementing the key based on the "Example 21–25" of CEP Dev Guide, I got an error saying my compound key class must implement Comparable.

      That's where my doubt is: how can I implement comparable and still take into account the custom property in the comparison as the comparable is just about bigger, smaller, and equal? Seems that if I use only the timestamp value, my custom property would be ingored and I would compare just based on the timestamp and I could end up comparing timestamp from key of accountId = A with timestamp from key of accountid = B.