title: how to set Shutdown parameters for rabbit mq listener
body: <p>we are trying to shutdown all process which are all running in micro service </p>
  
  <ol>
  <li>Any Consumer currently doing some work when trying to ack
  their current message </li>
  <li><p>Any other action on the channel. I'd like to let the consumers
  finish whatever message they're processing and then close everything
  down.</p></li>
  <li><p>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.</p></li>
  </ol>
  
  <p>we have created bean like below</p>
  
  <pre><code> @Bean
    public SimpleMessageListenerContainer SimpleMessageListenerContainer() {
  
        SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(rabbitConnectionFactory);
        container.setIdleEventInterval(60000L);
        container.setShutdownTimeout(900000); // tried 
        return container;
    }
  </code></pre>
  
  <p>with above bean tried to achieve but it did't work. we are using spring-rabbit 1.7.3.RELEASE.</p>
  
  <p>log:</p>
  
  <pre><code>2018-02-13 13:07:11.137  INFO 13412 --- [on(9)-127.0.0.1] o.s.a.r.l.SimpleMessageListenerContainer : Waiting for workers to finish.
  2018-02-13 13:07:11.137  INFO 13412 --- [on(9)-127.0.0.1] o.s.a.r.l.SimpleMessageListenerContainer : Successfully waited for workers to finish.
  2018-02-13 13:07:11.137  INFO 13412 --- [on(9)-127.0.0.1] o.s.c.s.DefaultLifecycleProcessor        : Stopping beans in phase 2147482647
  2018-02-13 13:07:11.137  INFO 13412 --- [on(9)-127.0.0.1] o.s.a.r.l.SimpleMessageListenerContainer : Waiting for workers to finish.
  2018-02-13 13:07:11.137  INFO 13412 --- [on(9)-127.0.0.1] o.s.a.r.l.SimpleMessageListenerContainer : Successfully waited for workers to finish.
  2018-02-13 13:07:11.137  INFO 13412 --- [on(9)-127.0.0.1] o.s.i.a.i.AmqpInboundChannelAdapter      : stopped inbound.x
  2018-02-13 13:07:11.138  INFO 13412 --- [on(9)-127.0.0.1] o.s.c.s.DefaultLifecycleProcessor        : Stopping beans in phase 1073741823
  2018-02-13 13:07:11.139  INFO 13412 --- [on(9)-127.0.0.1] o.s.a.r.l.SimpleMessageListenerContainer : Waiting for workers to finish.
  2018-02-13 13:07:11.139  INFO 13412 --- [on(9)-127.0.0.1] o.s.a.r.l.SimpleMessageListenerContainer : Successfully waited for workers to finish.
  2018-02-13 13:07:11.139  INFO 13412 --- [on(9)-127.0.0.1] o.s.i.a.i.AmqpInboundChannelAdapter      : stopped a
  2018-02-13 13:07:11.140  INFO 13412 --- [on(9)-127.0.0.1] o.s.a.r.l.SimpleMessageListenerContainer : Waiting for workers to finish.
  2018-02-13 13:07:11.140  INFO 13412 --- [on(9)-127.0.0.1] o.s.a.r.l.SimpleMessageListenerContainer : Successfully waited for workers to finish.
  2018-02-13 13:07:11.140  INFO 13412 --- [on(9)-127.0.0.1] o.s.i.a.i.AmqpInboundChannelAdapter      : stopped b
  2018-02-13 13:07:11.140  INFO 13412 --- [on(9)-127.0.0.1] o.s.a.r.l.SimpleMessageListenerContainer : Waiting for workers to finish.
  2018-02-13 13:07:11.140  INFO 13412 --- [on(9)-127.0.0.1] o.s.a.r.l.SimpleMessageListenerContainer : Successfully waited for workers to finish.
  2018-02-13 13:07:11.140  INFO 13412 --- [on(9)-127.0.0.1] o.s.i.a.i.AmqpInboundChannelAdapter      : stopped c
  2018-02-13 13:07:11.140  INFO 13412 --- [on(9)-127.0.0.1] o.s.a.r.l.SimpleMessageListenerContainer : Waiting for workers to finish.
  2018-02-13 13:07:11.140  INFO 13412 --- [on(9)-127.0.0.1] o.s.a.r.l.SimpleMessageListenerContainer : Successfully waited for workers to finish.
  2018-02-13 13:07:11.140  INFO 13412 --- [on(9)-127.0.0.1] o.s.i.a.i.AmqpInboundChannelAdapter      : stopped d
  2018-02-13 13:07:11.140  INFO 13412 --- [on(9)-127.0.0.1] o.s.a.r.l.SimpleMessageListenerContainer : Waiting for workers to finish.
  2018-02-13 13:07:11.140  INFO 13412 --- [on(9)-127.0.0.1] o.s.a.r.l.SimpleMessageListenerContainer : Successfully waited for workers to finish.
  2018-02-13 13:07:11.140  INFO 13412 --- [on(9)-127.0.0.1] o.s.i.a.i.AmqpInboundChannelAdapter      : stopped e
  2018-02-13 13:07:11.140  INFO 13412 --- [on(9)-127.0.0.1] o.s.c.s.DefaultLifecycleProcessor        : Stopping beans in phase 0
  2018-02-13 13:07:11.140  INFO 13412 --- [on(9)-127.0.0.1] o.s.i.e.EventDrivenConsumer              : Removing {json-to-object-transformer:convertEventJSONToObject} as a subscriber to the 'eventJSONToObjectChannel' channel
  2018-02-13 13:07:11.141  INFO 13412 --- [on(9)-127.0.0.1] o.s.i.c.DirectChannel                    : Channel 'xxx:local:8006.eventJSONToObjectChannel' has 0 subscriber(s).
  2018-02-13 13:07:11.143  INFO 13412 --- [on(9)-127.0.0.1] o.s.i.e.EventDrivenConsumer              : stopped convertEventJSONToObject
  2018-02-13 13:07:11.144  INFO 13412 --- [on(9)-127.0.0.1] o.s.i.e.EventDrivenConsumer              : Removing {bridge} as a subscriber to the 'asyncEventTypeRouterChannel' channel
  2018-02-13 13:07:11.144  INFO 13412 --- [on(9)-127.0.0.1] o.s.i.c.ExecutorChannel                  : Channel 'xxx:local:1234.asyncEventTypeRouterChannel' has 0 subscriber(s).
  2018-02-13 13:07:11.144  INFO 13412 --- [on(9)-127.0.0.1] o.s.i.e.EventDrivenConsumer              : stopped org.springframework.integration.config.ConsumerEndpointFactoryBean#0
  2018-02-13 13:07:11.144  INFO 13412 --- [on(9)-127.0.0.1] o.s.i.e.EventDrivenConsumer              : Removing {router:springIntEventRouter} as a subscriber to the 'eventTypeRouterChannel' channel
  2018-02-13 13:07:11.145  INFO 13412 --- [on(9)-127.0.0.1] o.s.i.c.DirectChannel                    : Channel 'xxx:local:1234.eventTypeRouterChannel' has 0 subscriber(s).
  </code></pre>
  
  <p>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.</p>
  
  <ul>
  <li>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</li>
  <li><p>we have tested by terminate button in STS and by ctr+c in console for <strong>above 1 and 2 point</strong> to achieve  but it's not waiting for mentioned shutdown time.kindly help on this.</p></li>
  <li><p>is there any way to determine the duration of shutdown time run.</p></li>
  </ul>