• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MessageConverter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: MessageListenerAdapter

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Test
public void 回復可能例外の場合はデフォルトの指定回数リトライが実行されて回復可能例外キューに配信される() throws Exception {
    container.setQueues(ctx.getBean("retryTestQueue", Queue.class));
    container.setMessageListener(new MessageListenerAdapter(new ApplicationRecoverableExceptionTestHandler(), ctx.getBean(MessageConverter.class)));
    recoverableContainer.setQueues(ctx.getBean("recoverableExceptionQueue", Queue.class));
    recoverableContainer.setMessageListener(new MessageListenerAdapter(new RecoverableTestHandler(), ctx.getBean(MessageConverter.class)));
    container.start();
    recoverableContainer.start();
    template.convertAndSend("retry.test.exchange", "retry.test.binding", new RetryTestBean("test"));
    assertThat(retry.await(30, TimeUnit.SECONDS), is(true));
    assertThat(retry.getCount(), is(0L));
    assertThat(recover.await(3, TimeUnit.SECONDS), is(true));
    assertThat(recover.getCount(), is(0L));
    container.stop();
    recoverableContainer.stop();
}
 
开发者ID:ctc-g,项目名称:sinavi-jfw,代码行数:17,代码来源:MessageListenerRetryTest.java


示例2: RabbitTemplateMock

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
public RabbitTemplateMock(
    AmqpTemplateMockManager mockManager,
    MessageConverter messageConverter,
    String defaultExchange) {
  this.mockManager = mockManager;
  this.messageConverter = messageConverter;
  this.setConnectionFactory(Mockito.mock(ConnectionFactory.class));
  this.setExchange(defaultExchange);
}
 
开发者ID:netshoes,项目名称:spring-cloud-sleuth-amqp,代码行数:10,代码来源:RabbitTemplateMock.java


示例3: commandBusRabbitTemplate

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean
@Autowired
public RabbitTemplate commandBusRabbitTemplate(final ConnectionFactory commandBusConnectionFactory, final MessageConverter commandBusMessageConverter) {

    log.info("Creating command bus RabbitMQ template with a custom JSON converter");
    final RabbitTemplate rabbitTemplate = new RabbitTemplate(commandBusConnectionFactory);
    rabbitTemplate.setMessageConverter(commandBusMessageConverter);

    return rabbitTemplate;
}
 
开发者ID:sem2nawara,项目名称:acme-solution,代码行数:11,代码来源:CommandBusConfigurer.java


示例4: eventBusRabbitTemplate

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean
@Autowired
public RabbitTemplate eventBusRabbitTemplate(final ConnectionFactory eventBusConnectionFactory, final MessageConverter eventBusMessageConverter) {

    log.info("Creating query event bus RabbitMQ template with a custom JSON converter");
    final RabbitTemplate rabbitTemplate = new RabbitTemplate(eventBusConnectionFactory);
    rabbitTemplate.setMessageConverter(eventBusMessageConverter);

    return rabbitTemplate;
}
 
开发者ID:sem2nawara,项目名称:acme-solution,代码行数:11,代码来源:EventBusConfigurer.java


示例5: eventBusRabbitTemplate

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean
@Autowired
@Primary
public RabbitTemplate eventBusRabbitTemplate(final ConnectionFactory eventBusConnectionFactory, final MessageConverter eventBusMessageConverter) {

    log.info("Creating event bus RabbitMQ template with a custom JSON converter");
    final RabbitTemplate rabbitTemplate = new RabbitTemplate(eventBusConnectionFactory);
    rabbitTemplate.setMessageConverter(eventBusMessageConverter);

    return rabbitTemplate;
}
 
开发者ID:sem2nawara,项目名称:acme-solution,代码行数:12,代码来源:EventBusConfigurer.java


示例6: jsonMessageConverter

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean
public MessageConverter jsonMessageConverter()
{
    final Jackson2JsonMessageConverter converter = new Jackson2JsonMessageConverter();
    converter.setClassMapper(classMapper());
    return converter;
}
 
开发者ID:microservices-demo,项目名称:queue-master,代码行数:8,代码来源:RabbitMqConfiguration.java


示例7: replicationRabbitTemplate

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean
public RabbitTemplate replicationRabbitTemplate(
        ConnectionFactory connectionFactory,
        MessageConverter replicationMessageConverter
) {
    RabbitTemplate template = new RabbitTemplate(connectionFactory);
    template.setReceiveTimeout(listeningTimeout);
    template.setExchange(replicationExchange);
    template.setMessageConverter(replicationMessageConverter);

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


示例8: rabbitTemplate

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean
public RabbitTemplate rabbitTemplate(
        ConnectionFactory connectionFactory,
        MessageConverter messageConverter
) {
    RabbitTemplate template = new RabbitTemplate(connectionFactory);
    template.setReceiveTimeout(listeningTimeout);
    template.setMessageConverter(messageConverter);

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


示例9: outRabbitTemplate

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean
public RabbitTemplate outRabbitTemplate(
        ConnectionFactory outConnectionFactory,
        MessageConverter outMessageConverter
) {
    RabbitTemplate template = new RabbitTemplate(outConnectionFactory);
    template.setReceiveTimeout(listeningTimeout);
    template.setQueue(resultQueue);
    template.setMessageConverter(outMessageConverter);

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


示例10: fileServerRabbitTemplate

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean
public RabbitTemplate fileServerRabbitTemplate(
        ConnectionFactory serverConnectionFactory,
        MessageConverter fileServerMessageConverter
) {
    RabbitTemplate template = new RabbitTemplate(serverConnectionFactory);
    template.setReceiveTimeout(listeningTimeout);
    template.setMessageConverter(fileServerMessageConverter);

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


示例11: assertThat

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Test
public void デフォルト値が設定されて指定のインスタンスがDIコンテナに登録される() {
    assertThat(config.host, is("127.0.0.1"));
    assertThat(config.port, is("5672"));
    assertThat(config.username, is("guest"));
    assertThat(config.password, is("guest"));
    assertThat(config.channelCacheSize, is(10));
    assertThat(context.getBean(ConnectionFactory.class), is(notNullValue()));
    assertThat(context.getBean(RabbitTemplate.class), is(notNullValue()));
    assertThat(context.getBean(MessageConverter.class), is(notNullValue()));
}
 
开发者ID:ctc-g,项目名称:sinavi-jfw,代码行数:12,代码来源:AmqpContextConfigTest.java


示例12: jsonConverter

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean
public MessageConverter jsonConverter() {
    return new Jackson2JsonMessageConverter();
}
 
开发者ID:laidu,项目名称:java-learn,代码行数:5,代码来源:JsonApp.java


示例13: messageConverter

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean
public MessageConverter messageConverter() {
  return new ContentTypeDelegatingMessageConverter();
}
 
开发者ID:netshoes,项目名称:spring-cloud-sleuth-amqp,代码行数:5,代码来源:SpringTestConfiguration.java


示例14: rabbitTemplate

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean
public RabbitTemplate rabbitTemplate(
    AmqpTemplateMockManager mockManager, MessageConverter messageConverter) {
  return new RabbitTemplateMock(mockManager, messageConverter, "my-default-exchange");
}
 
开发者ID:netshoes,项目名称:spring-cloud-sleuth-amqp,代码行数:6,代码来源:SpringTestConfiguration.java


示例15: messageConverter

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean
public MessageConverter messageConverter() {
    return new Jackson2JsonMessageConverter();
}
 
开发者ID:lemon-china,项目名称:lemon-dubbo-message,代码行数:5,代码来源:RabbitConfiguration.java


示例16: listenerAdapter

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean
public MessageListenerAdapter listenerAdapter(MQAwareListener listener, MessageConverter converter) {
    return new MessageListenerAdapter(listener, converter);
}
 
开发者ID:lemon-china,项目名称:lemon-rabbitmq,代码行数:5,代码来源:MQConsumerConfig.java


示例17: messageConverter

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean(name = RabbitUtils.DEFAULT_MESSAGE_CONVERTER_BEAN_NAME)
public MessageConverter messageConverter() {
    // 原生的Jackson2JsonMessageConverter对泛型处理有些问题,所以我继承了这个类重写了反序列化生成泛型JavaType的方法,如果以后这段代码可以,将原生的Jackson2JsonMessageConverter返回即可
    return new LodsveJackson2JsonMessageConverter();
}
 
开发者ID:lodsve,项目名称:lodsve-framework,代码行数:6,代码来源:RabbitConfiguration.java


示例18: jsonMessageConverter

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean
public MessageConverter jsonMessageConverter() {
    return new Jackson2JsonMessageConverter();
}
 
开发者ID:microservices-demo,项目名称:shipping,代码行数:5,代码来源:RabbitMqConfiguration.java


示例19: jacksonAmqpMessageConverter

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean 
MessageConverter jacksonAmqpMessageConverter(ObjectMapper aObjectMapper) {
  return new Jackson2JsonMessageConverter(aObjectMapper);
}
 
开发者ID:creactiviti,项目名称:piper,代码行数:5,代码来源:AmqpMessengerConfiguration.java


示例20: commandBusMessageConverter

import org.springframework.amqp.support.converter.MessageConverter; //导入依赖的package包/类
@Bean
public MessageConverter commandBusMessageConverter() {
    return new Jackson2JsonMessageConverter();
}
 
开发者ID:sem2nawara,项目名称:acme-solution,代码行数:5,代码来源:CommandBusConfigurer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TextField类代码示例发布时间:2022-05-21
下一篇:
Java UpdateType类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap