org.springframework.messaging.core.AbstractMessagingTemplate Java Examples

The following examples show how to use org.springframework.messaging.core.AbstractMessagingTemplate. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MessagingMessageConverter.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
public javax.jms.Message toMessage(Object object, Session session) throws JMSException, MessageConversionException {
	if (!(object instanceof Message)) {
		throw new IllegalArgumentException("Could not convert [" + object + "] - only [" +
				Message.class.getName() + "] is handled by this converter");
	}
	Message<?> input = (Message<?>) object;
	MessageHeaders headers = input.getHeaders();
	Object conversionHint = headers.get(AbstractMessagingTemplate.CONVERSION_HINT_HEADER);
	javax.jms.Message reply = createMessageForPayload(input.getPayload(), session, conversionHint);
	this.headerMapper.fromHeaders(headers, reply);
	return reply;
}
 
Example #2
Source File: MessagingMessageConverter.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
public javax.jms.Message toMessage(Object object, Session session) throws JMSException, MessageConversionException {
	if (!(object instanceof Message)) {
		throw new IllegalArgumentException("Could not convert [" + object + "] - only [" +
				Message.class.getName() + "] is handled by this converter");
	}
	Message<?> input = (Message<?>) object;
	MessageHeaders headers = input.getHeaders();
	Object conversionHint = headers.get(AbstractMessagingTemplate.CONVERSION_HINT_HEADER);
	javax.jms.Message reply = createMessageForPayload(input.getPayload(), session, conversionHint);
	this.headerMapper.fromHeaders(headers, reply);
	return reply;
}