vert.x icon indicating copy to clipboard operation
vert.x copied to clipboard

Provides feature that can be implemented using a customize Clustered-EventBus

Open leotu opened this issue 5 years ago • 6 comments

The "VertxImpl.java" constructor method force to create default ClusteredEventBus implementation, there is no way to create my specific implementation.

public class VertxImpl implements VertxInternal, MetricsProvider {
...
 private final EventBusInternal eventBus;
...
 VertxImpl(VertxOptions options, ClusterManager clusterManager, NodeSelector nodeSelector, VertxMetrics metrics, VertxTracer<?, ?> tracer, Transport transport, FileResolver fileResolver) {
 ...
 ...
 this.eventBus = clusterManager != null ? new ClusteredEventBus(this, options, clusterManager, nodeSelector) : new EventBusImpl(this);
 ...
 ...
}

leotu avatar May 26 '20 05:05 leotu

what is your actual use of having a different event bus implementation ?

vietj avatar May 26 '20 06:05 vietj

I want to my ClusteredEventBus to use WebSocket instead of NetClient, and it may support retry strategy when the message pending to pickup another server ASAP.

The possible solution is to extend ClusteredEventBus & ClusteredHandlerHolder override some methods (i,e. sendRemote , writeMessage, ...)

Or even rewrite most the package "io.vertx.core.eventbus.impl.clustered" files.

leotu avatar May 26 '20 15:05 leotu

we will brainstorm with @tsegismont about what we could do for this

On 26 May 2020, at 17:08, leotu [email protected] wrote:

I want to my ClusteredEventBus to use WebSocket instead of NetClient, and it may support retry strategy when the message pending to pickup another server ASAP.

The possible solution is to extend ClusteredEventBus & ClusteredHandlerHolder override some methods (i,e. sendRemote , writeMessage, ...)

Or event rewrite most the package "io.vertx.core.eventbus.impl.clustered" files.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/eclipse-vertx/vert.x/issues/3426#issuecomment-634085103, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABXDCXXHD4PHIERFVVLVHDRTPLN7ANCNFSM4NJ7ZSEA.

vietj avatar May 26 '20 15:05 vietj

How about using the same factory approach that is used for creating the Vertx object?

rpax avatar Feb 06 '21 14:02 rpax

@rpax what do you mean ?

vietj avatar Feb 08 '21 07:02 vietj

@rpax what do you mean ?

Sorry for the late response. I meant the old VertxFactory SPI. Seems that is not there anymore :D . But yes, allowing the use of SPI can do the trick

rpax avatar Mar 24 '21 09:03 rpax