vertx-lang-scala-docs_2.12 3.6.1 API < Back
 

# Packages

-  package root
  Definition Classes
    root
-  package io
  Definition Classes
    root
-  package vertx
  Definition Classes
    io
-  package scala
  Definition Classes
    vertx
-  package core
  Definition Classes
    scala
-  package eventbus
  Definition Classes
    core
- DeliveryContext
- DeliveryOptions
- EventBus
- EventBusOptions
- Message
- MessageConsumer
- MessageProducer

c

io.vertx.scala.core.eventbus

# EventBus 

###
Companion object EventBus

#### 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.

Linear Supertypes
Measured, AnyRef, Any
 
Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. EventBus
2. Measured
3. AnyRef
4. Any

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Instance Constructors

1.  new EventBus(_asJava: AnyRef)

### Value Members

1.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
2.  final def ##(): Int
   Definition Classes
     AnyRef → Any
3.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
4.  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

5.  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

6.  final def asInstanceOf[T0]: T0
   Definition Classes
     Any
7.  def asJava: AnyRef
   Definition Classes
     EventBus → Measured
8.  def clone(): AnyRef
   Attributes
     protected[java.lang]
   Definition Classes
     AnyRef
   Annotations
     @native() @throws( ... )
9.  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

10.  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

11.  final def eq(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
12.  def equals(arg0: Any): Boolean
    Definition Classes
      AnyRef → Any
13.  def finalize(): Unit
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )
14.  final def getClass(): Class[_]
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
15.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
16.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
17.  def isMetricsEnabled(): Boolean

    Whether the metrics are enabled for this measured object * @return `true` if metrics are enabled

    Whether the metrics are enabled for this measured object * @return `true` if metrics are enabled

    Definition Classes
      EventBus → Measured
18.  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

19.  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

20.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
21.  final def notify(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
22.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
23.  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

24.  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

25.  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

26.  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

27.  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

28.  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

29.  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

30.  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

31.  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

32.  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

33.  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

34.  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

35.  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.

36.  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.

37.  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

38.  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

39.  final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
      AnyRef
40.  def toString(): String
    Definition Classes
      AnyRef → Any
41.  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

42.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
43.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
44.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @native() @throws( ... )

### Inherited from Measured

### Inherited from AnyRef

### Inherited from Any

### Ungrouped