2

Running on my dev machine as single user, I have a solution where I consume messages through EasyNetQ/Rabbitmq. Sending and subscribing works well.

Now, however, I'm debugging an issue in the message handler and during the debugging, I can see that the message is removed from Unacked and put back in Ready. This causes a new thread to be spawned and makes my debugging unnessarily hard.

Is there a way to let RabbitMq relax and give me a little more time before the message is resend?

BR, Anders

Anders Juul
  • 2,407
  • 3
  • 34
  • 56
  • Do you want to [debug one of multiple threads](https://stackoverflow.com/questions/3901736/visual-studio-debug-one-of-multiple-threads)? – nilsK Jul 25 '19 at 09:38
  • I'd like to prevent the second thread to be spawned. There's only one message and I'd like to step through the code without having a second thread starting started with precisely same message. – Anders Juul Jul 25 '19 at 11:12

2 Answers2

1

Please try to increase the heartbeat timeout of RabbitMQ. The default value is 60 seconds.

Greenonline
  • 1,330
  • 8
  • 23
  • 31
1

You can put in connectionString of RabbitMQ, e.g.:

host=ZZZZZZZZZ;virtualHost=YYYYYYYYYY;username=uuuuuuu;password=ppppppp;prefetchcount=1;requestedHeartbeat=600

(requestedHeartbeat=600 == 10 minutes)

For more information: Connecting to RabbitMQ

Greenonline
  • 1,330
  • 8
  • 23
  • 31
ProESM
  • 11
  • 2
  • This solved my problem, not only when I'm in debug mode, but my program read multiples messages from the queue, and sometimes the action used to take longer than 60seconds to complete, so in certain cases, the process happened more than once, duplicating data causing errors. Thanks for this! – Lucas Lucena Jun 16 '21 at 23:58