mthizo247 / spring-cloud-netflix-zuul-websocket

Zuul reverse proxy web socket support
Apache License 2.0
139 stars 72 forks source link

Fail to start #1

Closed elioth010 closed 7 years ago

elioth010 commented 7 years ago

`*** APPLICATION FAILED TO START


Description:

Parameter 0 of method stompClient in com.github.mthizo247.cloud.netflix.zuul.web.socket.ZuulWebSocketConfiguration required a single bean, but 2 were found:

Action:

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed `

Fail to start by dependency injection the pom is

`

org.springframework.boot spring-boot-starter-websocket provided
    <dependency>
        <groupId>com.github.mthizo247</groupId>
        <artifactId>spring-cloud-netflix-zuul-websocket</artifactId>
        <version>1.0.0-RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-zuul</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-oauth2</artifactId>
    </dependency>
</dependencies>`

my Application.java is

`@EnableAutoConfiguration @EnableDiscoveryClient //@EnableZuulProxy @EnableZuulWebSocket @EnableWebSocketMessageBroker @ComponentScan public class Application {

public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
}

@Bean
public PreFilter preFilter() {
    return new PreFilter();
}

}`

mthizo247 commented 7 years ago

@elioth010 are you explicitly defining your own brokerMessageConverter? Could you somehow share the relevant code so I can take a look further. Thanks

elioth010 commented 7 years ago

@mthizo247 sorry i use kafka and use a message broker, setting Qualifier to the bean i fix the issue, but a have a Question: How do you integrate this to ribbon?

mthizo247 commented 7 years ago

I have not yet tried integrating the library with ribbon, would be a great use case to try that out though...

pal632022 commented 2 years ago

I am getting the same error as above. Can you please share the solution.