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


Java MappingJackson2MessageConverter.setTargetType方法代码示例

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


在下文中一共展示了MappingJackson2MessageConverter.setTargetType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

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

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

示例6: 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

示例7: 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.setTargetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。