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 applications written in Java that communicate with each other using XML
I have two forms in my rails app. They both exist in separate tabs
I have a cocoa app with two types windows each of which requires a
I have two classes, and want to include a static instance of one class
I have two threads, one needs to poll a bunch of separate static resources
I have two spreadsheets... when one gets modified in a certain way I want
I don't have very much information to work with here, yet. Our app sends
I have two applications. One is a Java thick client Swing GUI for controlling
So, in my program i have a TabActivity which contains two tabs, one tab
Using VB.NET in Visual Studio 2010, I have two files: test2.aspx and test2.aspx.vb. The

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.