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

arp.message.rocketmq.FSTDeserializationStrategy Maven / Gradle / Ivy

There is a newer version: 1.0.3
Show newest version
package arp.message.rocketmq;

import java.io.ByteArrayInputStream;

import org.nustaq.serialization.FSTConfiguration;
import org.nustaq.serialization.FSTObjectInput;

import arp.process.publish.Message;

public class FSTDeserializationStrategy implements
		RocketmqMessageDeserializationStrategy {

	private FSTConfiguration fstConf;

	public FSTDeserializationStrategy() {
		fstConf = FSTConfiguration.createJsonConfiguration();
		fstConf.setForceSerializable(true);
	}

	@Override
	public Message deserialize(byte[] body) throws Exception {
		FSTObjectInput ois = fstConf.getObjectInput(new ByteArrayInputStream(
				body));
		return (Message) ois.readObject();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy