title: How to deal with the aggregate root without repository, when using Spring Data Common to publish domain events
body: <p>The logic is: publish an event to notify closing a netty channel. Before, through <code>DomainEventPublish</code>, I publish the event at domain service, application service, or <code>catch</code>. Now, I found that it was wrong because only aggregate root can publish domain event.</p>
  
  <p>I plan to refactor the way of publishing domain events to using Spring Data Common. I can design an aggregate root named <code>ChannelToClose</code>, and with a method that will register the <code>NeedClose</code> event, but I can't publish the registered events. Spring Data Common publishes the registered events only when executing <code>save()</code> of a repository, so <strong>I don't know how to publish events when aggregate root doesn't need to be persisted</strong>.</p>
  
  <p>This is the comment of <code>org.springframework.data.domain.DomainEvents</code>:</p>
  
  <blockquote>
    <p>DomainEvents can be used on methods of aggregate roots managed by Spring Data repositories to publish the events returned by that method as Spring application events.</p>
  </blockquote>