I have an event pubblished in a bus(rabbit) and two application that are subscribed to this Event.
public class CreationEvent
{
public int CreationEventID {get; set; }
... other properties
}
Application A and Application B are subscribed to this event, and listen from a rabbit queue. Application A save the properties of this event in its database.
Application B save the properties of this event in its database. In addition create another event related to the CreationEventId with other properties and send it to a rabbit queue
public class ExtendCreationEvent
{
public int ExtendCreationEvent {get; set; }
public int CreationEventID {get; set; }
... other properties
}
Application A is subscribed to this Event and listen from a rabbit queue, read and save the properties in its database related to CreationEventID.
This is the problem. I don't know if the Application B is too fast and pubblish the event ExtendCreationEvent before ApplicationA save CreationEventID from the first event. So application A could try to elaborate event ExtendCreationEvent before the elaboration of CreationEvent .
How can I solve this problem and guarantee the elaboration order in Application A?