class EventBus extends Measured
A Vert.x event-bus is a light-weight distributed messaging system which allows different parts of your application, or different applications and services to communicate with each in a loosely coupled way.
An event-bus supports publish-subscribe messaging, point-to-point messaging and request-response messaging.
Message delivery is best-effort and messages can be lost if failure of all or part of the event bus occurs.
Please refer to the documentation for more information on the event bus.
- Alphabetic
- By Inheritance
- EventBus
- Measured
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new EventBus(_asJava: AnyRef)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addInboundInterceptor[T](interceptor: Handler[DeliveryContext[T]])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): EventBus
Add an interceptor that will be called whenever a message is received by Vert.x * @param interceptor the interceptor
Add an interceptor that will be called whenever a message is received by Vert.x * @param interceptor the interceptor
- returns
a reference to this, so the API can be used fluently
-
def
addOutboundInterceptor[T](interceptor: Handler[DeliveryContext[T]])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): EventBus
Add an interceptor that will be called whenever a message is sent from Vert.x * @param interceptor the interceptor
Add an interceptor that will be called whenever a message is sent from Vert.x * @param interceptor the interceptor
- returns
a reference to this, so the API can be used fluently
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asJava: AnyRef
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
consumer[T](address: String, handler: Handler[Message[T]])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): MessageConsumer[T]
Create a consumer and register it against the specified address.
Create a consumer and register it against the specified address. * @param address the address that will register it at
- handler
the handler that will process the received messages
- returns
the event bus message consumer
-
def
consumer[T](address: String)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): MessageConsumer[T]
Create a message consumer against the specified address.
Create a message consumer against the specified address.
The returned consumer is not yet registered at the address, registration will be effective when io.vertx.scala.core.eventbus.MessageConsumer#handler is called. * @param address the address that it will register it at
- returns
the event bus message consumer
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isMetricsEnabled(): Boolean
Whether the metrics are enabled for this measured object * @return
true
if metrics are enabled -
def
localConsumer[T](address: String, handler: Handler[Message[T]])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): MessageConsumer[T]
Like io.vertx.scala.core.eventbus.EventBus#consumer but the address won't be propagated across the cluster.
Like io.vertx.scala.core.eventbus.EventBus#consumer but the address won't be propagated across the cluster. * @param address the address that will register it at
- handler
the handler that will process the received messages
- returns
the event bus message consumer
-
def
localConsumer[T](address: String)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): MessageConsumer[T]
Like io.vertx.scala.core.eventbus.EventBus#consumer but the address won't be propagated across the cluster.
Like io.vertx.scala.core.eventbus.EventBus#consumer but the address won't be propagated across the cluster. * @param address the address to register it at
- returns
the event bus message consumer
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
publish(address: String, message: AnyRef, options: DeliveryOptions): EventBus
Like io.vertx.scala.core.eventbus.EventBus#publish but specifying
options
that can be used to configure the delivery.Like io.vertx.scala.core.eventbus.EventBus#publish but specifying
options
that can be used to configure the delivery. * @param address the address to publish it to- message
the message, may be
null
- options
the delivery options see DeliveryOptions
- returns
a reference to this, so the API can be used fluently
-
def
publish(address: String, message: AnyRef): EventBus
Publish a message.
Publish a message. The message will be delivered to all handlers registered to the address. * @param address the address to publish it to
- message
the message, may be
null
- returns
a reference to this, so the API can be used fluently
-
def
publisher[T](address: String, options: DeliveryOptions)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): MessageProducer[T]
Like io.vertx.scala.core.eventbus.EventBus#publisher but specifying delivery options that will be used for configuring the delivery of the message.
Like io.vertx.scala.core.eventbus.EventBus#publisher but specifying delivery options that will be used for configuring the delivery of the message. * @param address the address to publish it to
- options
the delivery options see DeliveryOptions
- returns
The publisher
-
def
publisher[T](address: String)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): MessageProducer[T]
Create a message publisher against the specified address.
Create a message publisher against the specified address.
The returned publisher will invoke the io.vertx.scala.core.eventbus.EventBus#publish method when the stream io.vertx.scala.core.streams.WriteStream#write method is called with the publisher address and the provided data. * @param address The address to publish it to
- returns
The publisher
-
def
registerCodec(codec: MessageCodec[_, _]): EventBus
Register a message codec.
Register a message codec.
You can register a message codec if you want to send any non standard message across the event bus. E.g. you might want to send POJOs directly across the event bus.
To use a message codec for a send, you should specify it in the delivery options.
- codec
the message codec to register
- returns
a reference to this, so the API can be used fluently
-
def
registerDefaultCodec[T](clazz: Class[T], codec: MessageCodec[T, _]): EventBus
Register a default message codec.
Register a default message codec.
You can register a message codec if you want to send any non standard message across the event bus. E.g. you might want to send POJOs directly across the event bus.
Default message codecs will be used to serialise any messages of the specified type on the event bus without the codec having to be specified in the delivery options.
- clazz
the class for which to use this codec
- codec
the message codec to register
- returns
a reference to this, so the API can be used fluently
-
def
removeInboundInterceptor[T](interceptor: Handler[DeliveryContext[T]])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): EventBus
Remove an interceptor that was added by io.vertx.scala.core.eventbus.EventBus#addInboundInterceptor * @param interceptor the interceptor
Remove an interceptor that was added by io.vertx.scala.core.eventbus.EventBus#addInboundInterceptor * @param interceptor the interceptor
- returns
a reference to this, so the API can be used fluently
-
def
removeOutboundInterceptor[T](interceptor: Handler[DeliveryContext[T]])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): EventBus
Remove an interceptor that was added by io.vertx.scala.core.eventbus.EventBus#addOutboundInterceptor * @param interceptor the interceptor
Remove an interceptor that was added by io.vertx.scala.core.eventbus.EventBus#addOutboundInterceptor * @param interceptor the interceptor
- returns
a reference to this, so the API can be used fluently
-
def
send[T](address: String, message: AnyRef, options: DeliveryOptions, replyHandler: Handler[AsyncResult[Message[T]]])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): EventBus
Like io.vertx.scala.core.eventbus.EventBus#send but specifying a
replyHandler
that will be called if the recipient subsequently replies to the message.Like io.vertx.scala.core.eventbus.EventBus#send but specifying a
replyHandler
that will be called if the recipient subsequently replies to the message. * @param address the address to send it to- message
the message, may be
null
- options
delivery options see DeliveryOptions
- replyHandler
reply handler will be called when any reply from the recipient is received, may be
null
- returns
a reference to this, so the API can be used fluently
-
def
send(address: String, message: AnyRef, options: DeliveryOptions): EventBus
Like io.vertx.scala.core.eventbus.EventBus#send but specifying
options
that can be used to configure the delivery.Like io.vertx.scala.core.eventbus.EventBus#send but specifying
options
that can be used to configure the delivery. * @param address the address to send it to- message
the message, may be
null
- options
delivery options see DeliveryOptions
- returns
a reference to this, so the API can be used fluently
-
def
send[T](address: String, message: AnyRef, replyHandler: Handler[AsyncResult[Message[T]]])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): EventBus
Like io.vertx.scala.core.eventbus.EventBus#send but specifying a
replyHandler
that will be called if the recipient subsequently replies to the message.Like io.vertx.scala.core.eventbus.EventBus#send but specifying a
replyHandler
that will be called if the recipient subsequently replies to the message. * @param address the address to send it to- message
the message, may be
null
- replyHandler
reply handler will be called when any reply from the recipient is received, may be
null
- returns
a reference to this, so the API can be used fluently
-
def
send(address: String, message: AnyRef): EventBus
Sends a message.
Sends a message.
The message will be delivered to at most one of the handlers registered to the address. * @param address the address to send it to
- message
the message, may be
null
- returns
a reference to this, so the API can be used fluently
-
def
sendFuture[T](address: String, message: AnyRef, options: DeliveryOptions)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): scala.concurrent.Future[Message[T]]
Like send but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
sendFuture[T](address: String, message: AnyRef)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): scala.concurrent.Future[Message[T]]
Like send but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.
-
def
sender[T](address: String, options: DeliveryOptions)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): MessageProducer[T]
Like io.vertx.scala.core.eventbus.EventBus#sender but specifying delivery options that will be used for configuring the delivery of the message.
Like io.vertx.scala.core.eventbus.EventBus#sender but specifying delivery options that will be used for configuring the delivery of the message. * @param address the address to send it to
- options
the delivery options see DeliveryOptions
- returns
The sender
-
def
sender[T](address: String)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): MessageProducer[T]
Create a message sender against the specified address.
Create a message sender against the specified address.
The returned sender will invoke the io.vertx.scala.core.eventbus.EventBus#send method when the stream io.vertx.scala.core.streams.WriteStream#write method is called with the sender address and the provided data. * @param address the address to send it to
- returns
The sender
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unregisterDefaultCodec(clazz: Class[_]): EventBus
Unregister a default message codec.
Unregister a default message codec.
- clazz
the class for which the codec was registered
- returns
a reference to this, so the API can be used fluently
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )