public void PublishMessage(DomainEvent thingToPublish) { var obs = new AtomEventObserver<DomainEvent>( Guid.NewGuid(), 400, new AtomEventsInMemory(), new DataContractContentSerializer(new TypeResolutionTable(new List<TypeResolutionEntry>()))); obs.AppendAsync(thingToPublish); }
public AtomEntry ConvertDomainEventToAtomEntry(DomainEvent eventToAdd) { var atomEntry = new AtomEntry(); var serializer = new JsonEventSerialisation(); var content = serializer.GetContentWithContentType(eventToAdd); atomEntry.Content = content.Content; atomEntry.Id = eventToAdd.Id; atomEntry.Updated = DateTime.Now; atomEntry.Title = content.ContentType; return atomEntry; }
public void PublishMessage(DomainEvent thingToPublish) { logger.Info("IEventPublisher Publishing event " + thingToPublish.Id); try { decoratedPublisher.PublishMessage(thingToPublish); logger.Info("IEventPublisher Published event " + thingToPublish.Id); } catch (Exception exception) { logger.Error(exception.ToString()); } }
private void Process(DomainEvent domainEvent) { repository.Add(this.CurrentDocumentId, converter.ConvertDomainEventToAtomEntry(domainEvent)).Wait(); numberOfEvents++; LogTraceInfo($"Fish Added event {numberOfEvents} to document with a maximum of {atomDocumentSettings.NumberOfEventsPerDocument} to document {CurrentDocumentId.Id}"); if (numberOfEvents > atomDocumentSettings.NumberOfEventsPerDocument) { numberOfEvents = 0; this.CurrentDocumentId = CurrentDocumentId.Add(1); LogTraceInfo("Moving To Next Document"); subscriptionActor.Tell(new NewDocumentAddedEvent(new DocumentId(CurrentDocumentId.Id))); } }
public void PublishMessage(DomainEvent thingToPublish) { actorRef.Tell(thingToPublish); this.actorSystem.EventStream.Publish(thingToPublish); }
public void Notify(SubscriptionMessage message, DomainEvent eventToNotify) { EventNotifiedWith = eventToNotify; EventReceived.Set(); }
private void Process(DomainEvent eventToProcess) { LoggingAdapter.Debug("Received an event notification " + eventToProcess.Id + " on subscription " + subscriptionMessage.SubscriptionId.Id); var notifier = notifierFactory.GetNotifierFor(subscriptionMessage.NotificationChannel.GetType()); notifier.Notify(subscriptionMessage, eventToProcess); }
private void Enqueue(DomainEvent message) { LogTraceInfo($"Added event {message.Id} to queue with sequence number {LastSequenceNr}"); var atomEntry = converter.ConvertDomainEventToAtomEntry(message); queuedItems.Add(atomEntry, LastSequenceNr); }
public void Notify(SubscriptionMessage message, DomainEvent eventToNotify) { factory.GetActorRef().Tell(new EventWithSubscriptionNotificationMessage(message.SubscriptionId, eventToNotify)); }
public EventWithSubscriptionNotificationMessage(SubscriptionId subscriptionId, DomainEvent eventToNotify) { SubscriptionId = subscriptionId; EventToNotify = eventToNotify; }
public void PublishMessage(DomainEvent thingToPublish) { mediator.Tell(new Publish("publishedEventsTopic", thingToPublish)); }