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

com.github.lontime.extredisson.service.RefServiceMessage Maven / Gradle / Ivy

The newest version!
package com.github.lontime.extredisson.service;

import com.github.lontime.base.serial.model.Header;
import com.github.lontime.base.serial.model.Message;
import com.github.lontime.extredisson.common.Constants;
import com.github.lontime.extredisson.common.Topic;
import lombok.Getter;
import lombok.Setter;

/**
 * @author apple
 */
@Getter
@Setter
public class RefServiceMessage {

    private Message message;
    private Topic topic;
    private String replyTo;
    private String msgId;

    public byte[] serialize() {
        return Message.builder().topic(topic.getOrig())
//                .addHeader(Header.from(Constants.HEADER_TOPIC_KIND, topic.getKind()))
//                .addHeader(Header.from(Constants.HEADER_TOPIC_NAME, topic.getOrig()))
//                .addHeader(Header.from(Constants.HEADER_TOPIC_TAG, topic.getTag()))
//                .addHeader(Header.from(Constants.HEADER_TOPIC_REF, Boolean.valueOf(topic.isRef()).toString()))
                .addHeader(Header.from(Constants.HEADER_REAL_MSG_ID, msgId))
                .serviceName(message.getServiceName()).methodName(message.getMethodName())
                .replyTo(replyTo).build().serializeToBytes();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy