com.github.longdt.vertxservice.codecs.MessageCodecs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vertx-service4j Show documentation
Show all versions of vertx-service4j Show documentation
A lightweight replacement for vertx-service-proxy. This library is highly optimized for vertx java
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