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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:20:59+00:00 2026-05-14T08:20:59+00:00

I am in the process of designing a system where i need to keep

  • 0

I am in the process of designing a system where i need to keep on trying to connect to MQ server unitl i get a connection.

By default if the MQ is not availlble it will thorugh exception. How can call the same method again and again until i get the connection. I know i can use recursion, is there any better way to do it . Becuase i would like to avoid infinite loops. I also want to wait the the furthere processing until i get connection.

I am using .net 2.0 with C#. It is window Service application.

  • 1 1 Answer
  • 3 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-14T08:20:59+00:00Added an answer on May 14, 2026 at 8:20 am

    The code samples already provided will get you the looping you need so I won’t duplicate that advice. However, I have a few suggestions.

    The .Net functionality in WMQ v7.0 is much better than in WMQ v6. Among the options available are that client reconnection can be handled entirely in channel configuration. Since v6 is End-of-Life as of Sept 2011 and this is a new application, I would highly recommend using the WMQ v7 client. You can use it with a v6 QMgr but won’t get all the v7 functionality. Preferably you can use a v7 QMgr as well, then you get the reconnection behavior as a configurable option. If you go with v6 now you will need to upgrade to v7 in the next 18 months if you want to be able to get support from IBM.

    IBM – MQC7: WebSphere MQ V7.0 Clients http://bit.ly/bXM0q3

    Assuming you will proceed with coding reconnection logic, you definitely want to sleep for at least a full second, and preferably several seconds, between reconnection attempts. Failure to do so will flood the WMQ listener and execute a very effective denial of service attack.

    Be sure to include the WMQ reason codes in the log messages. For example, if you are trying to put a message on a queue and get back a 2053 MQRC_Q_FULL it is usually a transient error caused by a fast-producer/slow-consumer problem. But if you get back 2035 MQRC_AUTHORIZATION_ERROR then there’s no chance of the program recovering without human intervention. If the logged messages do not have the WMQ reason code, it is very difficult to determine the root cause of errors in the transport layer.

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

Sidebar

Related Questions

I am currently in the process of designing a system which will use multiple
I'm in the process of designing a system that will allow me to represent
I'm designing a system to process plain text files, one of its features will
My team is in the process of designing a domain model which will hide
I'm currently in the early stages of designing a system that will end up
My Case: I'm working on a system that will need to create various X12
I'm in the process of designing a fairly complex system. One of our primary
I am in the process of designing a feature for a system where I
We are in the process of designing/creating restful web services that will be consumed
We're in the process of designing a tiny database that will contain data regarding

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.