Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't not connect to Rabbitmq Stream via port 5552 #344

Closed
LucasZhanye opened this issue Jul 29, 2024 · 6 comments · Fixed by #345
Closed

Can't not connect to Rabbitmq Stream via port 5552 #344

LucasZhanye opened this issue Jul 29, 2024 · 6 comments · Fixed by #345
Labels
bug Something isn't working

Comments

@LucasZhanye
Copy link

LucasZhanye commented Jul 29, 2024

Describe the bug

Firstly I follow the github description,use command: docker run -it --rm --name rabbitmq -p 5552:5552 -p 15672:15672
-e RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS='-rabbitmq_stream advertised_host localhost -rabbit loopback_users "none"'
rabbitmq:3.9.16 to start a container.
Secondly, I use golang to run this code:
_, err := stream.NewEnvironment(
stream.NewEnvironmentOptions().
SetHost("127.0.0.1").
SetPort(5552).
SetUser("guest").
SetPassword("guest").SetVHost("/"))
CheckErr(err)

It always report error:
2024/07/29 10:31:25 [error] - timeout 10000 ns - waiting Code, operation: Command not handled 27
2024/07/29 10:31:25 [error] - New environment creation. Can't connect to the broker: 127.0.0.1 port: 5552.
timeout 10000 ms - waiting Code, operation: Command not handled 27 exit status 1

And the Rabbitmq logs is:
2024-07-29 02:31:15.847950+00:00 [warn] <0.1230.0> unknown command {unknown,<<0,27,0,1,0,0,0,6,0,0,0,1,0,2,0,1,0,2>>}, sending close command.

Reproduction steps

  1. start a container:docker run -it --rm --name rabbitmq -p 5552:5552 -p 15672:15672
    -e RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS='-rabbitmq_stream advertised_host localhost -rabbit loopback_users "none"'
    rabbitmq:3-management
    2.enable plugin: docker exec rabbitmq rabbitmq-plugins enable rabbitmq_stream_management
  2. run go code
    ...

Expected behavior

I want to connect successful

Additional context

No response

@LucasZhanye LucasZhanye added the bug Something isn't working label Jul 29, 2024
@Gsantomaggio
Copy link
Member

Can you try with:

docker run -it --rm --name rabbitmq -p 5552:5552 -p 5672:5672 -p 15672:15672 \
    -e RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS='-rabbitmq_stream advertised_host localhost' \
    rabbitmq:3-management

then:

docker exec rabbitmq rabbitmq-plugins enable rabbitmq_stream_management

and try again using localhost

@LucasZhanye
Copy link
Author

Can you try with:

docker run -it --rm --name rabbitmq -p 5552:5552 -p 5672:5672 -p 15672:15672 \
    -e RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS='-rabbitmq_stream advertised_host localhost' \
    rabbitmq:3-management

then:

docker exec rabbitmq rabbitmq-plugins enable rabbitmq_stream_management

and try again using localhost

I had try it, it also failed.

But I have a try, to use rabbitmq-stream-go-client v1.3.0, it is ok!

Why high version not compatibility with rabbitmq 3.9.16?

@Gsantomaggio
Copy link
Member

Gsantomaggio commented Jul 29, 2024

@LucasZhanye work in progess here: #345
Even the 3.9.16 is not supported anymore

@LucasZhanye
Copy link
Author

@LucasZhanye work in progess here: #344 Even the 3.9.16 is not supported anymore

So If I still use rabbitmq server 3.9.16 (I can not change it),I can only use v1.3.0 of rabbitmq-stream-go-client?

And I have another question, I can not connect to remote rabbitmq server, maybe is about the env setting of 'advertised_host'?

How to set this env?

@Gsantomaggio
Copy link
Member

Gsantomaggio commented Jul 29, 2024

With this PR you will be able to use the last version even if you won't be able to use the features like super stream etc...

@Gsantomaggio
Copy link
Member

about advertised_host please read the documentation, here: the https://www.rabbitmq.com/blog/2021/07/23/connecting-to-streams

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants