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


Java RabbitTemplate.setMessageConverter方法代码示例

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


在下文中一共展示了RabbitTemplate.setMessageConverter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getObject

import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的package包/类
@Override
public AmqpTemplate getObject() throws Exception {
    RabbitTemplate rabbitTemplate = rabbitAdmin.getRabbitTemplate();
    rabbitTemplate.setMessageConverter(messageConverter);
    rabbitTemplate.setRetryTemplate(retryTemplate());

    if (messagingConfiguration.isMandatoryMessages()) {
        logger.info("will send mandatoryMessages, which expect at least one consumer");

        rabbitTemplate.setMandatory(true);
        rabbitTemplate.setReturnCallback(createReturnCallback());
    } else {
        logger.info("mandatory flag is not set, messages are not being set as mandatory");
    }

    return rabbitTemplate;
}
 
开发者ID:zeroDivisible,项目名称:spring-rabbitmq-example,代码行数:18,代码来源:AmqpTemplateFactory.java

示例2: rabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的package包/类
@Bean
public RabbitTemplate rabbitTemplate() {
	RabbitTemplate template = new RabbitTemplate(connectionFactory());
	template.setQueue(this.queueName);
       template.setMessageConverter(jsonMessageConverter());
	return template;
}
 
开发者ID:microservices-demo,项目名称:queue-master,代码行数:8,代码来源:ShippingConsumerConfiguration.java

示例3: rabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的package包/类
/**
 * This returns the RabbitMQ template.
 *
 * @return The RabbitMQ template.
 */
@Bean
RabbitTemplate rabbitTemplate()
{
    final RabbitTemplate template = new RabbitTemplate(rabbitConnectionFactory);
    template.setMessageConverter(messageConverter());
    template.setRetryTemplate(retryTemplate());
    return template;
}
 
开发者ID:dellemc-symphony,项目名称:ticketing-service-paqx-parent-sample,代码行数:14,代码来源:TicketingServiceRabbitConfig.java

示例4: rabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的package包/类
@Bean
@ConditionalOnSingleCandidate(ConnectionFactory.class)
@ConditionalOnMissingBean(RabbitTemplate.class)
public RabbitTemplate rabbitTemplate() {
    RabbitTemplate template = new RabbitTemplate(connectionFactory);
    RetryTemplate retryTemplate = new RetryTemplate();
    ExponentialBackOffPolicy backOffPolicy = new ExponentialBackOffPolicy();
    backOffPolicy.setInitialInterval(500);
    backOffPolicy.setMultiplier(10.0);
    backOffPolicy.setMaxInterval(10000);
    retryTemplate.setBackOffPolicy(backOffPolicy);
    template.setRetryTemplate(retryTemplate);
    template.setMessageConverter(messageConverter);
    return template;
}
 
开发者ID:lodsve,项目名称:lodsve-framework,代码行数:16,代码来源:RabbitConfiguration.java

示例5: commandBusRabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的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

示例6: eventBusRabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的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

示例7: eventBusRabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的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

示例8: rabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的package包/类
@Bean
public RabbitTemplate rabbitTemplate(Jackson2JsonMessageConverter converter) {
    RabbitTemplate template = new RabbitTemplate(connectionFactory);
    template.setRoutingKey(queueName);
    template.setMessageConverter(converter);
    return template;
}
 
开发者ID:giovannicandido,项目名称:audit-mq-collector,代码行数:8,代码来源:RabbitConfiguration.java

示例9: replicationRabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的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

示例10: rabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的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

示例11: outRabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的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

示例12: fileServerRabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的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

示例13: submitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的package包/类
@Bean
  public RabbitTemplate submitTemplate() {
      RabbitTemplate bean = new RabbitTemplate(connectionFactory());
      bean.setMessageConverter(jsonMessageConverter());
// para enviar, el binding del exchange se configura en el rabbitmq
      // server a la cola correspondiente (que aqui no interesa)
      bean.setExchange(env.getProperty("submit.exchange"));
      return bean;
  }
 
开发者ID:dovier,项目名称:coj-web,代码行数:10,代码来源:AMQPConfiguration.java

示例14: plagiarismDetectorTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的package包/类
@Bean
public RabbitTemplate plagiarismDetectorTemplate() {
    RabbitTemplate bean = new RabbitTemplate(connectionFactory());
    bean.setMessageConverter(jsonMessageConverter());
    bean.setExchange(env.getProperty("plagiarism.detection.exchange"));
    return bean;
}
 
开发者ID:dovier,项目名称:coj-web,代码行数:8,代码来源:AMQPConfiguration.java

示例15: rabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的package包/类
@Bean
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
//必须是prototype类型
public RabbitTemplate rabbitTemplate() {
    RabbitTemplate template = new RabbitTemplate(this.connectionFactory());
    template.setMessageConverter(this.jsonMessageConverter());
    template.setMandatory(true);
    return template;
}
 
开发者ID:liubo6,项目名称:demo_springboot_rabbitmq,代码行数:10,代码来源:AmqpConfig.java


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