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


Java MessageConverter类代码示例

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


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


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