Skip to content

Commit

Permalink
fix: remove RequiredArgsConstructor which was overriding spring quali…
Browse files Browse the repository at this point in the history
…fier

Since the introduction of Integration Controller in APIM, we can see the following error

`No qualifying bean of type 'io.gravitee.exchange.api.websocket.command.ExchangeSerDe' available: expected single matching bean but found 2: cockpitExchangeSerDe,integrationExchangeSerDe`

which was due to the extra contructor which applied different bean injection.
  • Loading branch information
jgiovaresco authored and guillaumelamirand committed Mar 28, 2024
1 parent 14cebfa commit b6117c8
Showing 1 changed file with 7 additions and 5 deletions.
Expand Up @@ -16,6 +16,7 @@
package io.gravitee.cockpit.connectors.ws;

import io.gravitee.cockpit.api.CockpitConnector;
import io.gravitee.cockpit.api.command.websocket.CockpitExchangeSerDe;
import io.gravitee.cockpit.connectors.ws.command.CockpitConnectorCommandContext;
import io.gravitee.common.service.AbstractService;
import io.gravitee.exchange.api.command.Command;
Expand Down Expand Up @@ -45,8 +46,9 @@
* @author Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com)
* @author GraviteeSource Team
*/
// This class is instanciated as a Spring Component by Gravitee Node
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
@Slf4j
@RequiredArgsConstructor
public class WebSocketCockpitConnector extends AbstractService<CockpitConnector> implements CockpitConnector {

public static final ProtocolVersion PROTOCOL_VERSION = ProtocolVersion.V1;
Expand All @@ -55,20 +57,20 @@ public class WebSocketCockpitConnector extends AbstractService<CockpitConnector>
private Vertx vertx;

@Autowired
private final ExchangeConnectorManager exchangeConnectorManager;
private ExchangeConnectorManager exchangeConnectorManager;

@Autowired
@Lazy
@Qualifier("cockpitConnectorCommandHandlersFactory")
private final ConnectorCommandHandlersFactory cockpitConnectorCommandHandlersFactory;
private ConnectorCommandHandlersFactory cockpitConnectorCommandHandlersFactory;

@Autowired
@Qualifier("cockpitWebsocketConnectorClientFactory")
private final WebSocketConnectorClientFactory cockpitWebsocketConnectorClientFactory;
private WebSocketConnectorClientFactory cockpitWebsocketConnectorClientFactory;

@Autowired
@Qualifier("cockpitExchangeSerDe")
private final ExchangeSerDe cockpitExchangeSerDe;
private ExchangeSerDe cockpitExchangeSerDe;

@Value("${cockpit.enabled:false}")
private boolean enabled;
Expand Down

0 comments on commit b6117c8

Please sign in to comment.