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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:48:02+00:00 2026-05-13T11:48:02+00:00

We have developed a custom WCF channel which communicates via IBM Websphere MQ. We

  • 0

We have developed a custom WCF channel which communicates via IBM Websphere MQ.

We have created a channel factory:

public class MqChannelFactory : ChannelFactoryBase<IRequestChannel>

Which returns instances of our channel:

public class MqRequestChannel : ChannelBase, IRequestChannel

Connecting to the IBM MQ queue manager is an expensive operation. Currently, we do this in Channel.OnOpen().

Following the guidelines for correct use of channels, we are callign ChannelFactory.CreateChannel() each time we require a channel, sending the message, then calling Channel.Close().

Our assumption was, that the ChannelFactory performed pooling of channels, so that when Channel.Close() was called, the channel was not actually closed but rather returned to the pool. But, everytime we call ChannelFactory.CreateChannel, a new channel is being instantiated, and when the request is sent, the expensive channel opening is performed.

So, the question: What is the best approach to prevent the channel being opened on every request?

Some of the options we are investigating:

  • Is there anyway through configuration to specify that channel pooling should take place? Should we be implementing our own channel pooling in our ChannelFactory?

  • Should we just keep our channel open for the life of the application, sending all requests through it?

  • Should we perform the expensive operation (connecting to the queue manager) in the channel factory , which we cache for the life of the application?

  • 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-13T11:48:02+00:00Added an answer on May 13, 2026 at 11:48 am

    There’s really no hard and fast rule as to what the best option is. Initially, I’d say the possibly easiest solution would be to cache client channels at the application level. Depending on your implementation, that might require some synchronization work, btw.

    You could potentially pool connections at the ChannelFactory level. I’d be hesitant to pool entire channels (there’s always some complexity there), but you could pool connections internally and have channels acquire connections when needed from the pool held by their channel factory.

    This does have the advantage that ClientBase already caches ClientFactory instances as of .NET 3.0 SP1, so that might make it easier on the application code (if you’re using it).

    The downside, though, is that that this might get harder to implement if the endpoint address has information that is needed to open the connection to the queue manager because you can potentially create channels for different endpoint addresses from a single ChannelFactory object. Likely this means that you’ll need to explicitly disallow this, or that your ChannelFactory implementation might need to keep multiple connection pools internally (one per endpoint address or something like that).

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

Sidebar

Related Questions

I have developed a basic custom JTableModel as follows public class CustomTableModel extends DefaultTableModel
We have our own custom calendar in our portal which is developed in Java.
We have an ASP.NET MVC application for which we have developed our own custom
I have developed a small WCF service which handles HTTP request. I want to
I have developed a custom binding which works over http and therefore returns http
I have developed an app which uses my own custom keyboard (well, a view
I have developed a custom webpart which is being displayed correctly and has some
I have developed an application which starts a custom service that fires a countdowntimer.
I have developed a custom control with two public property called ListField and DataSource.
I have developed a custom dijit Templated Widget. I have to do some DOM

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.