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

Connection not closed/not receiving messages after ~5 minutes #52

Open
Yoiink opened this issue Jan 5, 2017 · 3 comments
Open

Connection not closed/not receiving messages after ~5 minutes #52

Yoiink opened this issue Jan 5, 2017 · 3 comments

Comments

@Yoiink
Copy link

Yoiink commented Jan 5, 2017

Not really sure where the problem may be, you can find the connection code below.

All I'm doing is running the program, seeing it connect in RabbitMQ's Management, leave it for 5 minutes then close the program and the connection still shows in Management.

I think this also relates to an issue I'm having where in Management it looks like the message is being handled but does not ack after a long wait.

let amqp_url = "amqp://".to_string() + amqp_user.to_str().unwrap() + ":" + amqp_pass.to_str().unwrap() + "@rabbit-server/projectone";

let mut session = match Session::open_url(&amqp_url) {
    Ok(session) => session,
    Err(error) => 
        panic!("Can't create session: {:?}", error)
};

let mut channel = session.open_channel(1).ok().expect("Can't open channel");
println!("Opened channel: {}", channel.id);

let request_queue_name = "request";
let complete_queue_name = "complete";

let request_queue_declare = channel.queue_declare(request_queue_name, false, false, false, false, false, Table::new());
let complete_queue_declare = channel.queue_declare(complete_queue_name, false, false, false, false, false, Table::new());

let consumer_name = channel.basic_consume(consumer_function as ConsumerCallBackFn, request_queue_name, "",  false, false, false, false, Table::new());

let consumers_thread = thread::spawn(move || {
    channel.start_consuming();
    channel
});
@jareddlc
Copy link

I am also experiencing similar issue. After 5 mins of inactivity (not receiving messages) my application doesn't receive any subsequent messages, even though the rabbitmq management UI shows as connected, and receiving messages.

@jareddlc
Copy link

I think this may be due the client not having heartbeats. (https://www.rabbitmq.com/heartbeats.html) Depending of what version of rabbitmq server running, the default could be set to 580, and the interval heartbeats is set to 580/2 or 290 secs which is 4.8mins. After 2 failed heartbeats the connection is dropped.

@magnusja
Copy link

I am also experiencing similar issue. After 5 mins of inactivity (not receiving messages) my application doesn't receive any subsequent messages, even though the rabbitmq management UI shows as connected, and receiving messages.

exact same problem, any solution?

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