@Test @DisplayName("send messages between two contexts regardless of registration order") void mutual() { String suffix = IntegrationBrokerTest.class.getSimpleName(); BlackBoxContext photos = BlackBoxContext.from( BoundedContext.singleTenant("Photos-" + suffix) .add(PhotosProcMan.class) ); BlackBoxContext billing = BlackBoxContext.from( BoundedContext.singleTenant("Billing-" + suffix) .add(BillingAggregate.class) ); photos.receivesCommand(UploadPhotos.generate()); assertReceived(photos, PhotosUploaded.class); assertReceived(billing, CreditsHeld.class); assertReceived(photos, PhotosProcessed.class); photos.close(); billing.close(); }
@Override public void close() throws Exception { configurationObserver.close(); notifyTypesChanged(); subscriberHub.close(); publisherHub.close(); }
IntegrationBroker implements ContextAware, AutoCloseable { @Override public void close() throws Exception { configurationObserver.close(); notifyTypesChanged(); subscriberHub.close(); publisherHub.close(); } }
IntegrationBroker implements ContextAware, AutoCloseable { @Override public void close() throws Exception { configurationObserver.close(); notifyTypesChanged(); subscriberHub.close(); publisherHub.close(); } IntegrationBroker(); }
IntegrationBroker implements ContextAware, AutoCloseable { @Override public void close() throws Exception { configurationObserver.close(); notifyTypesChanged(); subscriberHub.close(); publisherHub.close(); } IntegrationBroker(); @Override void registerWith(BoundedContext context); @Override boolean isRegistered(); void register(EventDispatcher dispatcher); void unregister(EventDispatcher dispatcher); @Override void close(); @Override String toString(); }
IntegrationBroker implements ContextAware, AutoCloseable { @Override public void close() throws Exception { configurationObserver.close(); notifyTypesChanged(); subscriberHub.close(); publisherHub.close(); } IntegrationBroker(); @Override void registerWith(BoundedContext context); @Override boolean isRegistered(); void register(EventDispatcher dispatcher); void unregister(EventDispatcher dispatcher); @Override void close(); @Override String toString();  }