@Override
	protected Object convertFromInternal(Message<?> message, Class<?> targetClass, Object conversionHint) {
		Tuple t = (Tuple) message.getPayload();
		String json;
		if (prettyPrint) {
			ObjectMapper mapper = new ObjectMapper();
			mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
			try {
				Object tmp = mapper.readValue(t.toString(), Object.class);
				json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(tmp);
			}
			catch (IOException e) {
				logger.error(e.getMessage(), e);
				return null;
			}
		}
		else {
			json = t.toString();
		}
		return buildConvertedMessage(json, message.getHeaders(), MimeTypeUtils.APPLICATION_JSON);
	}
A {@link org.springframework.messaging.converter.MessageConverter}
to convert a {@link Tuple} to a JSON String

@author David Turanski
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/integration/bus/converter/TupleToJsonMessageConverter.java