本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}