Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3781510
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:57:09+00:00 2026-05-19T10:57:09+00:00

I have two app servers. One sends messages to the other using JMS. The

  • 0

I have two app servers. One sends messages to the other using JMS. The sender runs on Tomcat, with ActiveMQ used inside a Spring Framework template method call. The receiver runs on Jetty.

The problem is that when I restart one of the servers– the receiver of the messages– after it restarts it doesn’t get any more JMS messages until the other server is also restarted. I’m not sure why this is happening. Is there a way to only require a reboot of one server?

The sender XML configuration:

<bean id="producerJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory">
        <bean
            class="org.springframework.jms.connection.SingleConnectionFactory">
            <property name="targetConnectionFactory" ref="jmsFactory"/>
        </bean>
    </property>
</bean>

<bean id="simulationMessageSender" class="com.forio.simulate.activemq.SimulationMessageSenderImpl">
    <constructor-arg ref="producerJmsTemplate"/>
</bean>

<bean id="destination" class="org.apache.activemq.command.ActiveMQQueue"
    autowire="constructor">
    <constructor-arg value="com.forio.simulate.activemq"/>
</bean>

The sender java code:

public void send(final SimulationMessage simulationMessage) throws JMSException
{
    jmsTemplate.send(destination, new MessageCreator()
    {
        public Message createMessage(Session session) throws JMSException
        {
            Log.debug("Sending message: " + simulationMessage);
            ObjectMessage message = session.createObjectMessage(simulationMessage);
            message.setStringProperty("simulationMessage", "true");
            return message;
        }
    });
}

The receiver XML configuration:

<bean id="brokerContainer" class="org.apache.activemq.xbean.BrokerFactoryBean">
    <property name="config" value="classpath:activemq.xml" />
</bean>

<bean id="jmsFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="${jms.url}" />
</bean>

<bean id="destination" class="org.apache.activemq.command.ActiveMQQueue"
    autowire="constructor">
    <constructor-arg>
        <value>com.forio.simulate.activemq</value>
    </constructor-arg>
</bean>

<bean id="messageListener"
    class="com.forio.simulate.activemq.SimulationMessageListener">
    <property name="messageConverter">
        <bean
            class="com.forio.simulate.activemq.converter.SimulationMessageConverter" />
    </property>
    <property name="simulationMessageService" ref="simulationMessageService"/>
</bean>

<bean
    class="org.springframework.jms.listener.SimpleMessageListenerContainer" init-method="start">
    <property name="connectionFactory" ref="jmsFactory" />
    <property name="destination" ref="destination" />
    <property name="concurrentConsumers" value="3" />
    <property name="messageListener" ref="messageListener" />
</bean>

<bean id="consumerJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory" ref="jmsFactory" />
</bean>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T10:57:09+00:00Added an answer on May 19, 2026 at 10:57 am

    It is because you are using SingleConnectionFactory. each time SingleConnectionFactory.createConnection() is called, it returns the same connection, even after it is closed by restarting your receiving server.
    Maybe CachingConnectionFactory will suite your needs as it has some recover on exception mechanism.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two servers: one running a django app and one running both a
I have got one app running on two servers, one works and one doesnt
Is it possible to have two app.config files where one app.config serves as a
I have two buttons in my flex app next to each other, ButtonA and
When Using UIPickerController I have two choices on my App: take a picture take
I have two separate .NET applications, one server and another WinForms. WinForms app has
We're using Nginx to load balance between two upstream app servers and we'd like
I have two app icons built-in (free and premium), is it possible to replace
I have two UITextFields in the App as IBOutlets and I have made a
I have two sprites in my app. Both should have touches enabled and both

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.