当前位置: 首页>>代码示例>>Java>>正文


Java MappingJackson2MessageConverter类代码示例

本文整理汇总了Java中org.springframework.jms.support.converter.MappingJackson2MessageConverter的典型用法代码示例。如果您正苦于以下问题:Java MappingJackson2MessageConverter类的具体用法?Java MappingJackson2MessageConverter怎么用?Java MappingJackson2MessageConverter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MappingJackson2MessageConverter类属于org.springframework.jms.support.converter包,在下文中一共展示了MappingJackson2MessageConverter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testReplyWithJackson

import org.springframework.jms.support.converter.MappingJackson2MessageConverter; //导入依赖的package包/类
private TextMessage testReplyWithJackson(String methodName, String replyContent) throws JMSException {
	Queue replyDestination = mock(Queue.class);
	Message<String> request = MessageBuilder.withPayload("Response").build();

	Session session = mock(Session.class);
	MessageProducer messageProducer = mock(MessageProducer.class);
	TextMessage responseMessage = mock(TextMessage.class);
	given(session.createTextMessage(replyContent)).willReturn(responseMessage);
	given(session.createProducer(replyDestination)).willReturn(messageProducer);

	MessagingMessageListenerAdapter listener = getPayloadInstance(request, methodName, Message.class);
	MappingJackson2MessageConverter messageConverter = new MappingJackson2MessageConverter();
	messageConverter.setTargetType(MessageType.TEXT);
	listener.setMessageConverter(messageConverter);
	listener.setDefaultResponseDestination(replyDestination);
	listener.onMessage(mock(javax.jms.Message.class), session);

	verify(session, times(0)).createQueue(anyString());
	verify(session).createTextMessage(replyContent);
	verify(messageProducer).send(responseMessage);
	verify(messageProducer).close();
	return responseMessage;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:24,代码来源:MessagingMessageListenerAdapterTests.java

示例2: 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());
    }
  }
}
 
开发者ID:benjamin-cartereau,项目名称:w4-bpmnplus-module-jms,代码行数:26,代码来源:ApplicationConfig.java

示例3: 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;
}
 
开发者ID:LIBCAS,项目名称:ARCLib,代码行数:8,代码来源:JmsConfig.java

示例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;
}
 
开发者ID:ftsakiris,项目名称:async-engine,代码行数:8,代码来源:Application.java

示例5: 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;
}
 
开发者ID:wallerlab,项目名称:reaktor,代码行数:8,代码来源:Config.java

示例6: 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;
}
 
开发者ID:creactiviti,项目名称:piper,代码行数:9,代码来源:JmsMessengerConfiguration.java

示例7: outMessageConverter

import org.springframework.jms.support.converter.MappingJackson2MessageConverter; //导入依赖的package包/类
@Bean
public MessageConverter outMessageConverter() {
    MappingJackson2MessageConverter messageConverter = new MappingJackson2MessageConverter();
    messageConverter.setTypeIdPropertyName("typeId");

    return messageConverter;
}
 
开发者ID:dvoraka,项目名称:av-service,代码行数:8,代码来源:JmsBridgeOutputConfig.java

示例8: fileServerMessageConverter

import org.springframework.jms.support.converter.MappingJackson2MessageConverter; //导入依赖的package包/类
@Bean
public MessageConverter fileServerMessageConverter() {
    MappingJackson2MessageConverter messageConverter = new MappingJackson2MessageConverter();
    messageConverter.setTypeIdPropertyName("typeId");

    return messageConverter;
}
 
开发者ID:dvoraka,项目名称:av-service,代码行数:8,代码来源:JmsServerConfig.java

示例9: 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;
}
 
开发者ID:rajadilipkolli,项目名称:POC,代码行数:13,代码来源:JMSApplicationConfig.java

示例10: 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;
}
 
开发者ID:jangalinski,项目名称:springbootcamp,代码行数:13,代码来源:ActiveMqApplication.java


注:本文中的org.springframework.jms.support.converter.MappingJackson2MessageConverter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。