2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Shutdown時のタイムアウト時間を設定する

Posted at

Shutdown時のタイムアウト時間を設定する

Camelではシャットダウンする前に処理中のExchangeがある場合、300秒のタイムアウトまでは処理を継続するようになっています。
300秒が長い場合はタイムアウト時間を変更します。

以下はSPring XML DSLの場合の設定例です。
タイムアウト時間をデフォルト(300秒)から5秒に変更しています。

	<bean id="shutdownStrategy" class="org.apache.camel.impl.DefaultShutdownStrategy">
		<property name="timeout" value="5"/>
	</bean>

Java DSLの場合は公式サイト(Graceful Shutdown)に以下のようにコーディング例が記載されていたのですが、XML DSLの場合の例は見当たらなかったので投稿してみました。

        // give it 30 seconds to shutdown
        context.getShutdownStrategy().setTimeout(30);

参考

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?