1

i am trying to create a new rabbitmq stream where my rabbitmq is installed in docker.

Bellow are the steps which i implemented.

  1. installed RabbitMQ in docker under the TCP port 5672

  2. enabled rabbit stream and stream management

  3. installed rabbitmq.stream.client nuget in my project

  4. creating connection as below
    
  5. var config = new StreamSystemConfig
    {
        UserName = "guest",
        Password = "guest",
        VirtualHost = "/"
    };
    // Connect to the broker and create the system object
    // the entry point for the client.
    // Create it once and reuse it.
    var system = await StreamSystem.Create(config);
    
    const string stream = "my_first_stream";
    
  6. when i execute i am getting bellow erro

    RabbitMQ.Stream.Client.StreamSystemInitialisationException: 'no endpoints could be reached'

Can anyone please tell me the solution of this error?

Thank you Anil

I wanted to connect to stream and create stream and send messages to stream.

Anil Kumar
  • 23
  • 6

1 Answers1

0

Check again that you enabled the stream plugin. You can do so by running the command via the container terminal:

rabbitmq-plugins enable rabbitmq_stream

Or via docker exec:

docker exec rabbitmq rabbitmq-plugins enable rabbitmq_stream

Make sure to expose stream default port 5552 and localhost via the environment (-e) option, for example:

docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 -p 5552:5552 -e RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS='-rabbitmq_stream advertised_host localhost' rabbitmq:3.11-management
Yaniv
  • 966
  • 12
  • 20