0

Добрый день!

При работе с JMS возникла проблема reconnect'а соединения при перезагрузке JMS сервера. Имеется AS JBoss 1.7 - JMS Producer, Message Driven Bean как JMS Client. И, задача состоит в том, чтобы при перезагрузке JBoss'а восстановить JMS подключение клиента.

Нашел информацию про механизм javax.jms.ExceptionListener, который позволяет повесить листенер на обрыв соединения и вызвать reconnect. Но, я не нашел его применение для MDB, и, вероятно, что в MDB должен быть свой способ восстановления соединения - или я ошибаюсь, и его нужно донастраивать? Может есть другие варианты - настройка на уровне JMS конфигурации?

Благодарю за помощь.

1 ответ 1

0

Нашел ответ на свой вопрос в Sun Doc'ах:

Automatic Reconnection to JMS Provider

When the Sun Java System Application Server is started, for each deployed message-driven bean, its container keeps a connection to the JMS provider. When the connection is broken, the container is not able to receive messages from the JMS provider and, therefore, is unable to deliver messages to its message-driven bean instances. When the auto reconnection feature is enabled, the container automatically tries to reconnect to the JMS provider if the connection is broken.

The mdb-container element in the server.xml file contains auto reconnection properties. By default, reconnect-enabled is set to true and reconnect-delay-in-seconds is set to 60 seconds. That is, there is a delay of 60 seconds before each attempt to reconnect, and reconnect-max-retries is set to 60. The container logs messages for each reconnect attempt.

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.