#### Message Codecs

You can send any object you like across the event bus if you define and register a `message codec` for it.

Message codecs have a name and you specify that name in the `DeliveryOptions` when sending or publishing the message:

    eventBus.registerCodec(myCodec)

    def options = [
      codecName:myCodec.name()
    ]

    eventBus.send("orders", new docoverride.eventbus.Examples.MyPOJO(), options)

If you always want the same codec to be used for a particular type then you can register a default codec for it, then you don’t have to specify the codec on each send in the delivery options:

    Code not translatable

You unregister a message codec with `unregisterCodec`.

Message codecs don’t always have to encode and decode as the same type. For example you can write a codec that allows a MyPOJO class to be sent, but when that message is sent to a handler it arrives as a MyOtherPOJO class.