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

[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: FatalException: Lost connection to the server #128

Open
adiltola-kod opened this issue Sep 12, 2024 · 6 comments

Comments

@adiltola-kod
Copy link

I have a RabbitMQ broker in localhost in the port 15672 and I am trying to connect using your library to be able to listen messages through AMQP.
I could do it with c# but in flutter I am not be able to connect.

`ConnectionSettings settings = ConnectionSettings(
virtualHost: "mwmyjkim",
host: "localhost",
port: 15672,
authProvider: const PlainAuthenticator(
"username", "password"),

);
Client client = Client(settings: settings);
await client.connect();

Channel channel = await client.channel();
// auto-connect to localhost:5672 using guest credentials
Queue queue = await channel.queue(params.toString());
Consumer consumer = await queue.consume();
consumer.listen((AmqpMessage message) {
  // Get the payload as a string
  print(" [x] Received string: ${message.payloadAsString}");

  // Or unserialize to json
  print(" [x] Received json: ${message.payloadAsJson}");

  // Or just get the raw data as a Uint8List
  print(" [x] Received raw: ${message.payload}");

  // The message object contains helper methods for
  // replying, ack-ing and rejecting
  message.reply("world");
});

}`

Could not connect to 127.0.0.1:15672 after 1 attempts. Giving up" and if I put my ip address, it throws "FatalException: Lost connection to the server".

@boaz-amit
Copy link
Contributor

Port 15672 is usually reserved for the Management UI you see in the browser and the HTTP API. If you're using the default standard ports, the port setting should probably be 5672.

@adiltola-kod
Copy link
Author

15672 numaralı bağlantı noktası genellikle tarayıcıda gördüğünüz Yönetim Kullanıcı Arabirimi ve HTTP API'si için ayrılmıştır. Varsayılan standart bağlantı noktalarını kullanıyorsanız, bağlantı noktası ayarı büyük olasılıkla 5672 olmalıdır.

I am changing port what you say and i take this error
E/flutter ( 4299): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: ConnectionFailedException: Could not connect to 127.0.0.1:5672 after 1 attempts. Giving up

@boaz-amit
Copy link
Contributor

Have you made sure the local RabbitMQ server is running? If the server is running, do the server logs show the connection attempt?

@adiltola-kod
Copy link
Author

adiltola-kod commented Sep 13, 2024

Have you made sure the local RabbitMQ server is running? If the server is running, do the server logs show the connection attempt?

rabbitmq
Server is running but connection couldn't see in logs

@achilleasa
Copy link
Owner

Note that the listening port section in the posted screenshot, shows that the amqp listener (which this library is meant to connect to) is bound to ::5672.

@adiltola-kod
Copy link
Author

adiltola-kod commented Sep 13, 2024

Gönderilen ekran görüntüsündeki dinleme bağlantı noktası bölümünün, amqp dinleyicisinin (bu kitaplığın bağlanması amaçlanan) ::5672'ye bağlı olduğunu gösterdiğini unutmayın.

#128 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants