A Vert.x adapter connects event logs to a Vert.x instance.
A Vert.x adapter connects event logs to a Vert.x instance.
Event exchange is performed over the Vert.x event bus by event producers
.
An event producer
is a unidirectional connection between an event log and one or multiple event bus endpoints.
Events can be exchanged in both directions by different event producers
.
Event producers
are created using the EventProducer
factory methods and supplied to the adapter via the VertxAdapterConfig.
An adapter manages multiple event producers
, initializes the producers and establishes the connection to the supplied Vert.x instance.
A StorageProvider is used by the adapter to persist the replication progress of the individual event producers
.
Example:
val config = VertxAdapterConfig() .addProducer( EventProducer.fromLog(sourceLog) .publishTo { case _ => "address-1" } .as("vertx-producer") ) .addProducer( EventProducer.fromEndpoints("address-2") .writeTo(destinationLog) .as("log-producer") ) val adapter = VertxAdapter(config, vertx, storageProvider)(actorSystem) adapter.start()