diff --git a/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java b/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java index 1898ea543..7ca749129 100644 --- a/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java +++ b/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java @@ -52,8 +52,7 @@ import org.springframework.retry.support.RetryTemplate; import org.springframework.util.ErrorHandler; /** - * Spring configuration for AMQP based DMF communication for indirect device - * integration. + * Spring configuration for AMQP based DMF communication for indirect device integration. */ @Slf4j @EnableConfigurationProperties({ AmqpProperties.class, AmqpDeadletterProperties.class }) @@ -63,13 +62,10 @@ public class AmqpConfiguration { @Autowired private AmqpProperties amqpProperties; - @Autowired private AmqpDeadletterProperties amqpDeadletterProperties; - @Autowired private ConnectionFactory rabbitConnectionFactory; - @Autowired(required = false) private ServiceMatcher serviceMatcher; @@ -82,8 +78,9 @@ public class AmqpConfiguration { @Bean @ConditionalOnMissingBean public ErrorHandler errorHandler(final List handlers) { - return new DelegatingConditionalErrorHandler(handlers, new ConditionalRejectingErrorHandler( - new DelayedRequeueExceptionStrategy(amqpProperties.getRequeueDelay()))); + return new DelegatingConditionalErrorHandler( + handlers, + new ConditionalRejectingErrorHandler(new DelayedRequeueExceptionStrategy(amqpProperties.getRequeueDelay()))); } /** @@ -160,7 +157,9 @@ public class AmqpConfiguration { */ @Bean public Queue dmfReceiverQueue() { - return new Queue(amqpProperties.getReceiverQueue(), true, false, false, + return new Queue( + amqpProperties.getReceiverQueue(), + true, false, false, amqpDeadletterProperties.getDeadLetterExchangeArgs(amqpProperties.getDeadLetterExchange())); } @@ -172,8 +171,10 @@ public class AmqpConfiguration { */ @Bean public Queue authenticationReceiverQueue() { - return QueueBuilder.nonDurable(amqpProperties.getAuthenticationReceiverQueue()).autoDelete() - .withArguments(getTTLMaxArgsAuthenticationQueue()).build(); + return QueueBuilder.nonDurable(amqpProperties.getAuthenticationReceiverQueue()) + .autoDelete() + .withArguments(getTTLMaxArgsAuthenticationQueue()) + .build(); } /** @@ -197,27 +198,6 @@ public class AmqpConfiguration { 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. * @@ -259,7 +239,8 @@ public class AmqpConfiguration { */ @Bean @ConditionalOnMissingBean - public AmqpMessageHandlerService amqpMessageHandlerService(final RabbitTemplate rabbitTemplate, + public AmqpMessageHandlerService amqpMessageHandlerService( + final RabbitTemplate rabbitTemplate, final AmqpMessageDispatcherService amqpMessageDispatcherService, final ControllerManagement controllerManagement, final EntityFactory entityFactory, final SystemSecurityContext systemSecurityContext, diff --git a/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerService.java b/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerService.java index f52c83c53..f3aed3614 100644 --- a/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerService.java +++ b/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerService.java @@ -93,7 +93,8 @@ public class AmqpMessageHandlerService extends BaseAmqpService { * @param tenantConfigurationManagement the tenant configuration Management * @param confirmationManagement the confirmation management */ - public AmqpMessageHandlerService(final RabbitTemplate rabbitTemplate, + public AmqpMessageHandlerService( + final RabbitTemplate rabbitTemplate, final AmqpMessageDispatcherService amqpMessageDispatcherService, final ControllerManagement controllerManagement, final EntityFactory entityFactory, final SystemSecurityContext systemSecurityContext, diff --git a/hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/amqp/api/AmqpSettings.java b/hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/amqp/api/AmqpSettings.java index 58d643a97..37b560e86 100644 --- a/hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/amqp/api/AmqpSettings.java +++ b/hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/amqp/api/AmqpSettings.java @@ -19,5 +19,4 @@ import lombok.NoArgsConstructor; public final class AmqpSettings { public static final String DMF_EXCHANGE = "dmf.exchange"; - public static final String AUTHENTICATION_EXCHANGE = "authentication.exchange"; } \ No newline at end of file