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 8948663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:03:09+00:00 2026-06-15T13:03:09+00:00

I’ve got a little problem with JAX-WS. I’m using ActiveMQ as MOM and Spring.

  • 0

I’ve got a little problem with JAX-WS. I’m using ActiveMQ as MOM and Spring. The messaging is really simple: one jar should send a soap message with some data to another.

I defined the client this way in my sender_beans.xml:

<bean id="jmsConfig-Manager" class="org.apache.cxf.transport.jms.JMSConfiguration"
    p:connectionFactory-ref="jmsConnectionFactory"
    p:targetDestination="activemq:example.manager"
    p:pubSubDomain="true" p:maxConcurrentConsumers="40" p:deliveryMode="1"
    p:explicitQosEnabled="true" p:reconnectOnException="true" />

<bean id="jmsConnectionFactory"
    class="org.springframework.jms.connection.CachingConnectionFactory">
    <property name="sessionCacheSize" value="40" />

    <property name="targetConnectionFactory">
        <bean class="org.apache.activemq.ActiveMQConnectionFactory">
            <property name="brokerURL"

                value="tcp://localhost:61616?jms.useAsyncSend=true" />
        </bean>
    </property>
</bean>

And this is my endpoint:

<jaxws:endpoint id="ManagerService" implementor="#ManagerServ"
    implementorClass="com.example.Service"
    address="jms://">
    <jaxws:features>
        <bean class="org.apache.cxf.transport.jms.JMSConfigFeature"
            p:jmsConfig-ref="jmsConfig-Manager" />
    </jaxws:features>
</jaxws:endpoint>
<bean id="jmsConnectionFactory"
    class="org.springframework.jms.connection.CachingConnectionFactory">
    <property name="sessionCacheSize" value="40" />

    <property name="targetConnectionFactory">
        <bean class="org.apache.activemq.ActiveMQConnectionFactory">
            <property name="brokerURL"

                value="tcp://localhost:61616?jms.useAsyncSend=true" />
        </bean>
    </property>
</bean>

So, the messaging works – but only 40 times! (Which is the value of ever p:maxConcurrentConsumers). I think the problem is that every time a message is send, a new consumer is created but never destroyed. So after 40 messages no new consumer can be created and the messaging stops working. I have to restart the complete messaging.

I only can use the declarative way to fix this problem, I never call anything from jms in my code.

  • 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-06-15T13:03:10+00:00Added an answer on June 15, 2026 at 1:03 pm

    The CachingConnectionFactory by default will cache message consumers and producers. You can disable this by setting the cacheConsumers and cacheProducers properties to ‘false’.

    I.e. for your Spring xml:

    <bean id="jmsConnectionFactory"
    class="org.springframework.jms.connection.CachingConnectionFactory">
       <property name="sessionCacheSize" value="40" />
       <property name="cacheConsumers" value="false" />
       <property name="targetConnectionFactory">
    ...
    

    I had a recent issue where programmatically created Message Consumers weren’t being destroyed when calling .close() on the consumer object (I could still see the active consumers on the ActiveMQ admin console). cacheConsumers = false resolved this for me.

    Furthermore, read the Spring API on the Caching and Single connection factories to ensure you are using the correct one for your scenario – they mention all of this.

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

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I am reading a book about Javascript and jQuery and using one of the
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.