Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring MQ JMS reconnect configuration
    primarykey
    data
    text
    <p>First I have a question on how to configure JMS MQ to reconnect to an application when the broker connection is shutdown and restarted.</p> <p>Below is what I tried,</p> <p>This is the configuration that I initially had in my spring-mq-jms-connections.xml</p> <pre><code>&lt;!-- Spring JMS Queue Connection Factory --&gt; &lt;!-- &lt;bean id="jmsQueueConnectionFactory.7" class="org.springframework.jms.connection.SingleConnectionFactory" &gt; &lt;property name="targetConnectionFactory"&gt; &lt;ref bean="internalJmsQueueConnectionFactory.7"/&gt; &lt;/property&gt; &lt;/bean&gt; --&gt; </code></pre> <p>I replaced this with the below configuration introduced "DefaultMessageListenerContainer" which would wrap "SingleConnectionFactory". </p> <pre><code>&lt;bean id="jmsQueueConnectionFactory.7" class="org.springframework.jms.listener.DefaultMessageListenerContainer"&gt; &lt;property name="connectionFactory"&gt; &lt;ref bean="single.connection.factory.7"/&gt; &lt;/property&gt; &lt;property name="recoveryInterval" value="5000"/&gt; &lt;/bean&gt; &lt;bean id="single.connection.factory.7" class="org.springframework.jms.connection.SingleConnectionFactory"&gt; &lt;property name="targetConnectionFactory"&gt; &lt;ref bean="internalJmsQueueConnectionFactory.7"/&gt; &lt;/property&gt; &lt;/bean&gt; </code></pre> <p>But I started getting the below exception after this configuration change.</p> <pre><code>Failed to configure emapi: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'senderAgent.7' defined in URL [file://localhost/home/qos/qosdata/config/general/emapi/spring-mq-jms-connections.xml]: Cannot resolve reference to bean 'jmsQueueTemplate.7' while setting bean property 'jmsTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsQueueTemplate.7' defined in URL [file://localhost/home/qos/qosdata/config/general/emapi/spring-mq-jms-connections.xml]: Cannot resolve reference to bean 'jmsQueueConnectionFactory.7' while setting bean property 'connectionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsQueueConnectionFactory.7' defined in URL [file://localhost/home/qos/qosdata/config/general/emapi/spring-mq-jms-connections.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'destination' or 'destinationName' is required at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1244) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1008) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:470) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) </code></pre> <p>It says 'destination' or 'destinationName' is required, I am dealing with legacy code, not sure where to look for this or I am doing the right thing when I changed the configuration. </p> <p>Please suggest if there is any better way to reconnect OpenMQ with an application when the broker connection goes down due to exception or when it is restarted. I also looked at spring jms connection factory with exception listener, but couldnt figure out.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload