Remove AUTHENTICATION_EXCHANGE as unused (#1953)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-11-06 11:38:52 +02:00
committed by GitHub
parent cf797905d5
commit 7a0735c17e
3 changed files with 15 additions and 34 deletions

View File

@@ -52,8 +52,7 @@ import org.springframework.retry.support.RetryTemplate;
import org.springframework.util.ErrorHandler; import org.springframework.util.ErrorHandler;
/** /**
* Spring configuration for AMQP based DMF communication for indirect device * Spring configuration for AMQP based DMF communication for indirect device integration.
* integration.
*/ */
@Slf4j @Slf4j
@EnableConfigurationProperties({ AmqpProperties.class, AmqpDeadletterProperties.class }) @EnableConfigurationProperties({ AmqpProperties.class, AmqpDeadletterProperties.class })
@@ -63,13 +62,10 @@ public class AmqpConfiguration {
@Autowired @Autowired
private AmqpProperties amqpProperties; private AmqpProperties amqpProperties;
@Autowired @Autowired
private AmqpDeadletterProperties amqpDeadletterProperties; private AmqpDeadletterProperties amqpDeadletterProperties;
@Autowired @Autowired
private ConnectionFactory rabbitConnectionFactory; private ConnectionFactory rabbitConnectionFactory;
@Autowired(required = false) @Autowired(required = false)
private ServiceMatcher serviceMatcher; private ServiceMatcher serviceMatcher;
@@ -82,8 +78,9 @@ public class AmqpConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public ErrorHandler errorHandler(final List<AmqpErrorHandler> handlers) { public ErrorHandler errorHandler(final List<AmqpErrorHandler> handlers) {
return new DelegatingConditionalErrorHandler(handlers, new ConditionalRejectingErrorHandler( return new DelegatingConditionalErrorHandler(
new DelayedRequeueExceptionStrategy(amqpProperties.getRequeueDelay()))); handlers,
new ConditionalRejectingErrorHandler(new DelayedRequeueExceptionStrategy(amqpProperties.getRequeueDelay())));
} }
/** /**
@@ -160,7 +157,9 @@ public class AmqpConfiguration {
*/ */
@Bean @Bean
public Queue dmfReceiverQueue() { public Queue dmfReceiverQueue() {
return new Queue(amqpProperties.getReceiverQueue(), true, false, false, return new Queue(
amqpProperties.getReceiverQueue(),
true, false, false,
amqpDeadletterProperties.getDeadLetterExchangeArgs(amqpProperties.getDeadLetterExchange())); amqpDeadletterProperties.getDeadLetterExchangeArgs(amqpProperties.getDeadLetterExchange()));
} }
@@ -172,8 +171,10 @@ public class AmqpConfiguration {
*/ */
@Bean @Bean
public Queue authenticationReceiverQueue() { public Queue authenticationReceiverQueue() {
return QueueBuilder.nonDurable(amqpProperties.getAuthenticationReceiverQueue()).autoDelete() return QueueBuilder.nonDurable(amqpProperties.getAuthenticationReceiverQueue())
.withArguments(getTTLMaxArgsAuthenticationQueue()).build(); .autoDelete()
.withArguments(getTTLMaxArgsAuthenticationQueue())
.build();
} }
/** /**
@@ -197,27 +198,6 @@ public class AmqpConfiguration {
return BindingBuilder.bind(dmfReceiverQueue()).to(dmfSenderExchange()); return BindingBuilder.bind(dmfReceiverQueue()).to(dmfSenderExchange());
} }
/**
* Create authentication exchange.
*
* @return the fanout exchange
*/
@Bean
public FanoutExchange authenticationExchange() {
return new FanoutExchange(AmqpSettings.AUTHENTICATION_EXCHANGE, false, true);
}
/**
* Create the Binding {@link AmqpConfiguration#authenticationReceiverQueue()} to
* {@link AmqpConfiguration#authenticationExchange()}.
*
* @return the binding and create the queue and exchange
*/
@Bean
public Binding bindAuthenticationSenderExchangeToAuthenticationQueue() {
return BindingBuilder.bind(authenticationReceiverQueue()).to(authenticationExchange());
}
/** /**
* Create dead letter queue. * Create dead letter queue.
* *
@@ -259,7 +239,8 @@ public class AmqpConfiguration {
*/ */
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public AmqpMessageHandlerService amqpMessageHandlerService(final RabbitTemplate rabbitTemplate, public AmqpMessageHandlerService amqpMessageHandlerService(
final RabbitTemplate rabbitTemplate,
final AmqpMessageDispatcherService amqpMessageDispatcherService, final AmqpMessageDispatcherService amqpMessageDispatcherService,
final ControllerManagement controllerManagement, final EntityFactory entityFactory, final ControllerManagement controllerManagement, final EntityFactory entityFactory,
final SystemSecurityContext systemSecurityContext, final SystemSecurityContext systemSecurityContext,

View File

@@ -93,7 +93,8 @@ public class AmqpMessageHandlerService extends BaseAmqpService {
* @param tenantConfigurationManagement the tenant configuration Management * @param tenantConfigurationManagement the tenant configuration Management
* @param confirmationManagement the confirmation management * @param confirmationManagement the confirmation management
*/ */
public AmqpMessageHandlerService(final RabbitTemplate rabbitTemplate, public AmqpMessageHandlerService(
final RabbitTemplate rabbitTemplate,
final AmqpMessageDispatcherService amqpMessageDispatcherService, final AmqpMessageDispatcherService amqpMessageDispatcherService,
final ControllerManagement controllerManagement, final EntityFactory entityFactory, final ControllerManagement controllerManagement, final EntityFactory entityFactory,
final SystemSecurityContext systemSecurityContext, final SystemSecurityContext systemSecurityContext,

View File

@@ -19,5 +19,4 @@ import lombok.NoArgsConstructor;
public final class AmqpSettings { public final class AmqpSettings {
public static final String DMF_EXCHANGE = "dmf.exchange"; public static final String DMF_EXCHANGE = "dmf.exchange";
public static final String AUTHENTICATION_EXCHANGE = "authentication.exchange";
} }