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

com.godmao.mqbroker.handler.HeartbeatMessageEncoderHandler Maven / Gradle / Ivy

There is a newer version: 0.2.7.RELEASE
Show newest version
package com.godmao.mqbroker.handler;

import com.godmao.mqbroker.message.HeartbeatMessage;
import com.godmao.netty.handler.AbstractEncoderHandler;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.netty.channel.ChannelHandler;


@ChannelHandler.Sharable
public class HeartbeatMessageEncoderHandler extends AbstractEncoderHandler {

    public static final HeartbeatMessageEncoderHandler INSTANCE = new HeartbeatMessageEncoderHandler();

    @Override
    public ByteBuf encode(HeartbeatMessage.Response msg) {
        ByteBuf byteBuf = ByteBufAllocator.DEFAULT.buffer(1);
        byteBuf.writeByte(msg.getCmd());
        return byteBuf;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy