This discussion is archived
3 Replies Latest reply: Oct 23, 2012 11:15 PM by Junger He RSS

BroadcastOutputAdapter: monotonic compound keys - possible?

679068 Newbie
Currently Being Moderated
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.



  • Correct Answers - 10 points
  • Helpful Answers - 5 points