Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command ID / Message ID #364

Closed
paneq opened this issue May 28, 2018 · 3 comments
Closed

Command ID / Message ID #364

paneq opened this issue May 28, 2018 · 3 comments
Assignees
Milestone

Comments

@paneq
Copy link
Member

paneq commented May 28, 2018

Yo, in relation to #346 #362

I wanted to achieve common API for getting command ID's and event ID's.

  • Right now for event's the API is event_id.

  • command_bus does not impose any structure on commands right now

  • event_id does not sound like a good API for command ID's that could be used by #correlate_with() which currently looks like:

    def correlate_with(other_message)
        self.correlation_id = other_message.correlation_id || other_message.event_id
        self.causation_id   = other_message.event_id
    end

I think both (events and commands) are messages so it feels natural for me to assume message_id as the common interface. That would mean adding message_id reader to RubyEventStore::Event and changing the code correlate_with code to:

def correlate_with(other_message)
   self.correlation_id = other_message.correlation_id || other_message.message_id
   self.causation_id   = other_message.message_id
end

Does that make sense in your opinion?

For commands we are still not going to enforce/assume any schema or class etc. But if they follow the message_id interface, they could be used as an argument to correlate_with:

event.correlate_with(command)
@paneq paneq added this to the v0.31 milestone May 28, 2018
@paneq paneq self-assigned this May 28, 2018
@joelvh
Copy link
Contributor

joelvh commented May 28, 2018

@paneq I think the message_id makes sense. Do you see some more 1st class Command existing in RES at some point?

@joelvh
Copy link
Contributor

joelvh commented May 28, 2018

I would also potentially push for message_id being the actual value and event_id being an alias... but I know that is a much bigger change.

@paneq
Copy link
Member Author

paneq commented May 28, 2018

Do you see some more 1st class Command existing in RES at some point?

At some point probably, but I don't have a vision for it yet.

I would also potentially push for message_id being the actual value and event_id being an alias... but I know that is a much bigger change.

Well, we could maintain both getters and setters...

paneq added a commit that referenced this issue May 29, 2018
* message_id as general Message interface compatible
  with events and commands.

Issue: #346 #364
@paneq paneq closed this as completed May 29, 2018
@paneq paneq modified the milestones: v0.31, v0.30 May 29, 2018
paneq added a commit that referenced this issue May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants