Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Message bus integration and processing events

$
0
0

I have just downloaded joliver eventstore and looking to wire up a service bus with Azure / Windows Service Bus 1.0. I see the delegate is wired up to dispatch messages to a bus:

private static void DispatchCommit(Commit commit)
{
// This is where we'd hook into our messaging infrastructure, such as NServiceBus etc
foreach (var @event in commit.Events)        
Console.WriteLine(Resources.MessagesDispatched + ((SomeDomainEvent)@event.Body).Value);
}

If a bounded context has been offline whilst events in other contexts have been created (or indeed it may even be a new context that has been deployed), what is the recommended way for the bounded-context to sync itself using the available feature-set of Service Bus 1.0?

I'm thinking of adding some discovery messages with the following scenario:

1) We have ContextA, ContextB and ContextC, all connected using Service Bus 1.0 and each context with their own event store.
2) ContextC goes offline.
3) When ContextC comes back-up, he sends a BoundedContextOnlineEvent on to the bus, telling ContextA to resend from message sequence (abitary count in this case) 10, and sequence 22 for ContextB.
4) ContextA and ContextB process this request, and replay the events from the event store from sequence 10 and 22 for ContextA and ContextB respectively.

I could create the following messages something similair to:

public class RemoteContextLastEvent
{
 public string ContextName {get;set;}
 public long LastReceivedSequence {get;set;}
}

public class BoundedContextOnlineEvent
{
 public string FromContextName {get;set;}
 public RemoteContextLastEvent[] ContextsWhoShouldRespond {get; set;}
}


Any comments on the above would be appreciated.


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>