@Singleton
public class DtoToJson {
public String getJson(String body, String from, MessageType type){
MyAutoBeanFactory beanFactory = AutoBeanFactorySource.create(MyAutoBeanFactory.class);
MessageResponse response = new MessageResponse();
response.setFrom(from);
response.setMessage(body);
response.setMessageType(type);
AutoBean<IMessageResponse> bean = beanFactory.create(IMessageResponse.class, response);
String json = AutoBeanCodex.encode(bean).getPayload();
return json;
}