本文整理汇总了Java中org.springframework.jms.support.converter.MappingJackson2MessageConverter.setTypeIdPropertyName方法的典型用法代码示例。如果您正苦于以下问题:Java MappingJackson2MessageConverter.setTypeIdPropertyName方法的具体用法?Java MappingJackson2MessageConverter.setTypeIdPropertyName怎么用?Java MappingJackson2MessageConverter.setTypeIdPropertyName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.jms.support.converter.MappingJackson2MessageConverter
的用法示例。
在下文中一共展示了MappingJackson2MessageConverter.setTypeIdPropertyName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setMapping
import org.springframework.jms.support.converter.MappingJackson2MessageConverter; //导入方法依赖的package包/类
/**
* Define any mapping
*
* @param endpointId if of the endpoint
* @param listener listener
*/
private void setMapping(final String endpointId, AbstractAdaptableMessageListener listener) {
String mapping = getEndpointProperty(endpointId, CONFIGURATION_KEY_JMS_ENDPOINT_MAPPING);
if (MAPPING_JSON.equalsIgnoreCase(mapping)) {
MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
converter.setTypeIdPropertyName(JMS_PROPERTY_DTO_CLASSNAME);
listener.setMessageConverter(converter);
} else if (mapping != null && !MAPPING_NONE.equalsIgnoreCase(mapping)) {
StringBuilder errorMessage = new StringBuilder();
errorMessage.append("Mapping type ('").append(mapping);
errorMessage.append("') unknown for endpoint ").append(endpointId).append(" : only 'none' or 'json' are allowed.");
if (ignoreErroneousEndpoint) {
errorMessage.append(" None mapping will be used.");
logger.warn(errorMessage.toString());
}
else {
throw new IllegalArgumentException(errorMessage.toString());
}
}
}
示例2: jacksonJmsMessageConverter
import org.springframework.jms.support.converter.MappingJackson2MessageConverter; //导入方法依赖的package包/类
@Bean
public MessageConverter jacksonJmsMessageConverter() {
MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
converter.setTargetType(MessageType.TEXT);
converter.setTypeIdPropertyName("_type");
return converter;
}
示例3: jacksonJmsMessageConverter
import org.springframework.jms.support.converter.MappingJackson2MessageConverter; //导入方法依赖的package包/类
@Bean // Serialize message content to json using TextMessage
public MessageConverter jacksonJmsMessageConverter() {
MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
converter.setTargetType(MessageType.TEXT);
converter.setTypeIdPropertyName("_type");
return converter;
}
示例4: jacksonJmsMessageConverter
import org.springframework.jms.support.converter.MappingJackson2MessageConverter; //导入方法依赖的package包/类
@Bean // Serialize message content to json using TextMessage
public MessageConverter jacksonJmsMessageConverter() {
MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
converter.setTargetType(MessageType.TEXT);
converter.setTypeIdPropertyName("_type");
return converter;
}
示例5: jacksonJmsMessageConverter
import org.springframework.jms.support.converter.MappingJackson2MessageConverter; //导入方法依赖的package包/类
@Bean
public MessageConverter jacksonJmsMessageConverter(ObjectMapper aObjectMapper) {
MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
converter.setObjectMapper(aObjectMapper);
converter.setTargetType(MessageType.TEXT);
converter.setTypeIdPropertyName("_type");
return converter;
}
示例6: outMessageConverter
import org.springframework.jms.support.converter.MappingJackson2MessageConverter; //导入方法依赖的package包/类
@Bean
public MessageConverter outMessageConverter() {
MappingJackson2MessageConverter messageConverter = new MappingJackson2MessageConverter();
messageConverter.setTypeIdPropertyName("typeId");
return messageConverter;
}
示例7: fileServerMessageConverter
import org.springframework.jms.support.converter.MappingJackson2MessageConverter; //导入方法依赖的package包/类
@Bean
public MessageConverter fileServerMessageConverter() {
MappingJackson2MessageConverter messageConverter = new MappingJackson2MessageConverter();
messageConverter.setTypeIdPropertyName("typeId");
return messageConverter;
}
示例8: jacksonJmsMessageConverter
import org.springframework.jms.support.converter.MappingJackson2MessageConverter; //导入方法依赖的package包/类
/**
* <p>jacksonJmsMessageConverter.</p>
*
* @return a {@link org.springframework.jms.support.converter.MessageConverter} object.
*/
@Bean
public MessageConverter jacksonJmsMessageConverter() {
final MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
converter.setTargetType(MessageType.TEXT);
converter.setTypeIdPropertyName("_type");
return converter;
}
示例9: jacksonJmsMessageConverter
import org.springframework.jms.support.converter.MappingJackson2MessageConverter; //导入方法依赖的package包/类
/**
* Serialize message content to json using TextMessage
* @return messageConverter
*/
@Bean
public MessageConverter jacksonJmsMessageConverter() {
final MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
converter.setTargetType(MessageType.TEXT);
converter.setTypeIdPropertyName("_type");
return converter;
}