org.springframework.cloud.stream.binder.ExtendedConsumerProperties.getMaxAttempts()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(287)

本文整理了Java中org.springframework.cloud.stream.binder.ExtendedConsumerProperties.getMaxAttempts()方法的一些代码示例,展示了ExtendedConsumerProperties.getMaxAttempts()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExtendedConsumerProperties.getMaxAttempts()方法的具体详情如下:
包路径:org.springframework.cloud.stream.binder.ExtendedConsumerProperties
类名称:ExtendedConsumerProperties
方法名:getMaxAttempts

ExtendedConsumerProperties.getMaxAttempts介绍

暂无

代码示例

代码示例来源:origin: spring-cloud-incubator/spring-cloud-alibaba

@Override
protected MessageProducer createConsumerEndpoint(ConsumerDestination destination,
    String group,
    ExtendedConsumerProperties<RocketMQConsumerProperties> consumerProperties)
    throws Exception {
  if (group == null || "".equals(group)) {
    throw new RuntimeException(
        "'group must be configured for channel " + destination.getName());
  }
  RocketMQInboundChannelAdapter rocketInboundChannelAdapter = new RocketMQInboundChannelAdapter(
      consumersManager, consumerProperties, destination.getName(), group,
      instrumentationManager);
  ErrorInfrastructure errorInfrastructure = registerErrorInfrastructure(destination,
      group, consumerProperties);
  if (consumerProperties.getMaxAttempts() > 1) {
    rocketInboundChannelAdapter
        .setRetryTemplate(buildRetryTemplate(consumerProperties));
    rocketInboundChannelAdapter
        .setRecoveryCallback(errorInfrastructure.getRecoverer());
  }
  else {
    rocketInboundChannelAdapter
        .setErrorChannel(errorInfrastructure.getErrorChannel());
  }
  return rocketInboundChannelAdapter;
}

代码示例来源:origin: org.springframework.cloud/spring-cloud-stream-binder-rocketmq

@Override
protected MessageProducer createConsumerEndpoint(ConsumerDestination destination,
    String group,
    ExtendedConsumerProperties<RocketMQConsumerProperties> consumerProperties)
    throws Exception {
  if (group == null || "".equals(group)) {
    throw new RuntimeException(
        "'group must be configured for channel + " + destination.getName());
  }
  RocketMQInboundChannelAdapter rocketInboundChannelAdapter = new RocketMQInboundChannelAdapter(
      consumersManager, consumerProperties, destination.getName(), group,
      instrumentationManager);
  ErrorInfrastructure errorInfrastructure = registerErrorInfrastructure(destination,
      group, consumerProperties);
  if (consumerProperties.getMaxAttempts() > 1) {
    rocketInboundChannelAdapter
        .setRetryTemplate(buildRetryTemplate(consumerProperties));
    rocketInboundChannelAdapter
        .setRecoveryCallback(errorInfrastructure.getRecoverer());
  }
  else {
    rocketInboundChannelAdapter
        .setErrorChannel(errorInfrastructure.getErrorChannel());
  }
  return rocketInboundChannelAdapter;
}

代码示例来源:origin: org.springframework.cloud/spring-cloud-stream-binder-kafka11

ErrorInfrastructure errorInfrastructure = registerErrorInfrastructure(destination, consumerGroup,
    extendedConsumerProperties);
if (extendedConsumerProperties.getMaxAttempts() > 1) {
  kafkaMessageDrivenChannelAdapter.setRetryTemplate(buildRetryTemplate(extendedConsumerProperties));
  kafkaMessageDrivenChannelAdapter.setRecoveryCallback(errorInfrastructure.getRecoverer());

代码示例来源:origin: spring-cloud/spring-cloud-stream-binder-kafka

ErrorInfrastructure errorInfrastructure = registerErrorInfrastructure(destination, consumerGroup,
    extendedConsumerProperties);
if (extendedConsumerProperties.getMaxAttempts() > 1) {
  kafkaMessageDrivenChannelAdapter.setRetryTemplate(buildRetryTemplate(extendedConsumerProperties));
  kafkaMessageDrivenChannelAdapter.setRecoveryCallback(errorInfrastructure.getRecoverer());

代码示例来源:origin: org.springframework.cloud/spring-cloud-stream-binder-kafka

ErrorInfrastructure errorInfrastructure = registerErrorInfrastructure(destination, consumerGroup,
    extendedConsumerProperties);
if (extendedConsumerProperties.getMaxAttempts() > 1) {
  kafkaMessageDrivenChannelAdapter.setRetryTemplate(buildRetryTemplate(extendedConsumerProperties));
  kafkaMessageDrivenChannelAdapter.setRecoveryCallback(errorInfrastructure.getRecoverer());

代码示例来源:origin: org.springframework.cloud/spring-cloud-stream-binder-rabbit

else if (properties.getMaxAttempts() > 1) {
  return new MessageHandler() {
    private final RejectAndDontRequeueRecoverer recoverer = new RejectAndDontRequeueRecoverer();

代码示例来源:origin: spring-cloud/spring-cloud-stream-binder-rabbit

else if (properties.getMaxAttempts() > 1) {
  return new MessageHandler() {
    private final RejectAndDontRequeueRecoverer recoverer = new RejectAndDontRequeueRecoverer();

代码示例来源:origin: org.springframework.cloud/spring-cloud-stream-binder-rabbit

adapter.setHeaderMapper(mapper);
ErrorInfrastructure errorInfrastructure = registerErrorInfrastructure(consumerDestination, group, properties);
if (properties.getMaxAttempts() > 1) {
  adapter.setRetryTemplate(buildRetryTemplate(properties));
  adapter.setRecoveryCallback(errorInfrastructure.getRecoverer());

代码示例来源:origin: spring-cloud/spring-cloud-stream-binder-rabbit

adapter.setHeaderMapper(mapper);
ErrorInfrastructure errorInfrastructure = registerErrorInfrastructure(consumerDestination, group, properties);
if (properties.getMaxAttempts() > 1) {
  adapter.setRetryTemplate(buildRetryTemplate(properties));
  adapter.setRecoveryCallback(errorInfrastructure.getRecoverer());

相关文章