All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.longdt.vertxservice.codecs.MessageCodecs Maven / Gradle / Ivy

Go to download

A lightweight replacement for vertx-service-proxy. This library is highly optimized for vertx java

There is a newer version: 1.1.1
Show newest version
package com.github.longdt.vertxservice.codecs;

import io.vertx.core.Vertx;
import io.vertx.core.eventbus.MessageCodec;

public class MessageCodecs {
    public static  boolean registerDefaultCodec(Vertx vertx, Class clazz, MessageCodec codec) {
        try {
            vertx.eventBus().registerDefaultCodec(clazz, codec);
            return true;
        } catch (IllegalStateException ex) {
            return false;
        }
    }

    public static boolean registerCodec(Vertx vertx, MessageCodec codec) {
        try {
            vertx.eventBus().registerCodec(codec);
            return true;
        } catch (IllegalStateException ex) {
            return false;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy