The context
I have two components A & B, which communicate through events .
Components B is responsible for long running background processes and it listens to the following event:
startProcess(uniqueID)
Component A is sending the startProcess events.
The issue
I need the IDs sent by component A to be unique, cause elsewhere component B breaks.
Possible solutions
When component B receives an ID that has already been assigned to another a background job, does not accept it therefore rejects the initiation of a new background process.
The problem here is that component A does not know about the rejection, in contrast to a Http request response design, where the error is communicated through the response.
Question
Is there a better way to handle this, other than silently component B rejecting initiating a new process ? A definitely solution would be to forget about events and do this request/response way. But in general, how do event driven systems handle these kind of scenarios ?
Last
What I am doing at the moment is that component A bears the responsibility to send unique IDs. Is that the solution I am after?