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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:02:03+00:00 2026-05-23T16:02:03+00:00

I am developing a Web Service solution that is hosted inside a JBoss 4.2.3

  • 0

I am developing a Web Service solution that is hosted inside a JBoss 4.2.3 sever and connects to a JMS queue that is hosted on another server.

So far I am creating a new connection to the JMS queue each time the web service is called, this means that, whenever a new session is opened a new connection to the JMS queue is created.

For example, I use the code below to create the Producer:

    InitialContext jmsContext;
    ConnectionFactory connectionFactory;
    Properties properties;
    Queue queue;

    properties = JMSProperties.getJNDIProperties();

    jmsContext = new InitialContext(properties);

    connectionFactory = (ConnectionFactory) jmsContext.lookup("ConnectionFactory");

    connection = connectionFactory.createConnection();

    session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

    queue = (Queue) jmsContext.lookup(queueName);

    producer = session.createProducer(queue);

    connection.start();

I am aware that this implementation is not very efficient and I am thinking about creating a connection pool so that I don’t have to create a new connection everytime the web service receives a new request.

How can I configure JBoss so that it will create a connection pool to the JMS queue? Does the ConnectionFactory class automatically creates a connection pool for me? If so how can I configure the pool’s size?

Thanks,
Felipe

  • 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-23T16:02:04+00:00Added an answer on May 23, 2026 at 4:02 pm

    This wiki link should help: http://community.jboss.org/wiki/JBossJMSRA

    =======================================================

    Update:
    Here is the post with more information on configuration involved. I would strongly recommend to compare elapsed time for your existing approach and this one. The reason being this interesting post which suggests that JCA caching does not come into picture for remote connection factories bound to local JNDI. If that’s the case, you could use the approach that Nicholas mentioned. Basically create and cache JMS connection with decent hooks in place to refresh that connection (when needed).

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

Sidebar

Related Questions

I am developing a web service that renders characters using the PHP GD extension,
I am developing an application in that after making a web service I got
I am developing a free mobile app that accesses a Web Service and downloads
Hi all We are developing a web service that will be available through SOAP
I'm developing a web service whose methods will be called from a dynamic banner
I'm actually developing a Web Service in Java using Axis 2. I designed my
I'm developing a web service (in asp.net) and I would like to have each
We are developing a new web service and are looking into the best practice
We're developing a Python web service and a client web site in parallel. When
We are busy developing a Java web service for a client. There are two

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.