private boolean isNotFromSelf(final RemoteApplicationEvent event) { return serviceMatcher != null && !serviceMatcher.isFromSelf(event); }
@EventListener(classes = RemoteApplicationEvent.class) public void acceptLocal(RemoteApplicationEvent event) { if (this.serviceMatcher.isFromSelf(event) && !(event instanceof AckRemoteApplicationEvent)) { this.cloudBusOutboundChannel.send(MessageBuilder.withPayload(event).build()); } }
@EventListener(classes = RemoteApplicationEvent.class) public void acceptLocal(RemoteApplicationEvent event) { if (this.serviceMatcher.isFromSelf(event) && !(event instanceof AckRemoteApplicationEvent)) { this.cloudBusOutboundChannel.send(MessageBuilder.withPayload(event).build()); } }
@StreamListener(SpringCloudBusClient.INPUT) public void acceptRemote(RemoteApplicationEvent event) { if (event instanceof AckRemoteApplicationEvent) { if (this.bus.getTrace().isEnabled() && !this.serviceMatcher.isFromSelf(event) && this.applicationEventPublisher != null) { this.applicationEventPublisher.publishEvent(event); if (!this.serviceMatcher.isFromSelf(event)) { this.applicationEventPublisher.publishEvent(event);
@StreamListener(SpringCloudBusClient.INPUT) public void acceptRemote(RemoteApplicationEvent event) { if (event instanceof AckRemoteApplicationEvent) { if (this.bus.getTrace().isEnabled() && !this.serviceMatcher.isFromSelf(event) && this.applicationEventPublisher != null) { this.applicationEventPublisher.publishEvent(event); if (!this.serviceMatcher.isFromSelf(event)) { this.applicationEventPublisher.publishEvent(event);
/** * Was overridden that not every event has to run within a own * tenantAware. */ @Override public void multicastEvent(final ApplicationEvent event, final ResolvableType eventType) { if (applicationEventFilter.filter(event)) { return; } if (serviceMatcher == null || !(event instanceof RemoteTenantAwareEvent)) { super.multicastEvent(event, eventType); return; } final RemoteTenantAwareEvent remoteEvent = (RemoteTenantAwareEvent) event; if (serviceMatcher.isFromSelf(remoteEvent)) { super.multicastEvent(event, eventType); return; } tenantAware.runAsTenant(remoteEvent.getTenant(), () -> { super.multicastEvent(event, eventType); return null; }); }
/** * Was overridden that not every event has to run within a own * tenantAware. */ @Override public void multicastEvent(final ApplicationEvent event, final ResolvableType eventType) { if (applicationEventFilter.filter(event)) { return; } if (serviceMatcher == null || !(event instanceof RemoteTenantAwareEvent)) { super.multicastEvent(event, eventType); return; } final RemoteTenantAwareEvent remoteEvent = (RemoteTenantAwareEvent) event; if (serviceMatcher.isFromSelf(remoteEvent)) { super.multicastEvent(event, eventType); return; } tenantAware.runAsTenant(remoteEvent.getTenant(), () -> { super.multicastEvent(event, eventType); return null; }); }