Skip to content
Advertisement

how to set Shutdown parameters for rabbit mq listener

we are trying to shutdown all process which are all running in micro service

  1. Any Consumer currently doing some work when trying to ack their current message
  2. Any other action on the channel. I’d like to let the consumers finish whatever message they’re processing and then close everything down.

  3. if we stop the running process and allow the transfer of data then wait until the specified time period mentioned in shutdown hook timeout and then it gets terminated.

we have created bean like below

JavaScript

with above bean tried to achieve but it did’t work. we are using spring-rabbit 1.7.3.RELEASE.

log:

JavaScript

have tried with setting shutdown properties to container but still it gets shutdown by default sec or before that ;and not with override set properties.

  • Is it a better way to set for each and every inbound-channel-adapter the shutdown properties, if that’s the case we have to configure for more than 100 channel
  • we have tested by terminate button in STS and by ctr+c in console for above 1 and 2 point to achieve but it’s not waiting for mentioned shutdown time.kindly help on this.

  • is there any way to determine the duration of shutdown time run.

Advertisement

Answer

It works exactly as you have it…

JavaScript

Result:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement