Author |
Message
|
sathyapbe |
Posted: Mon Apr 16, 2018 11:01 pm Post subject: Channel opening closing type from C# .NET to IBM MQ |
|
|
Novice
Joined: 16 Apr 2018 Posts: 21
|
I am new to C# .net to IBM web sphere MQ integration.
Recently I have developed an API(C# .NET) for IBM web sphere MQ. I found some sample code from the developer sites.
The end client wants to change the channel opening closing type and they have given the below comment. Is there any sample C# client code to achieve the below.
API code is using the channel very inefficiently – it is opening a connection on the channel, putting a message, closing the channel,
opening the channel again to do the read for the reply and then closing the channel again.
This MUST be changed to open the channel perform its actions and only close the channel after a period of inactivity |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Apr 17, 2018 2:33 am Post subject: Re: Channel opening closing type from C# .NET to IBM MQ |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
sathyapbe wrote: |
I am new to C# .net to IBM web sphere MQ integration.
Recently I have developed an API(C# .NET) for IBM web sphere MQ. I found some sample code from the developer sites.
The end client wants to change the channel opening closing type and they have given the below comment. Is there any sample C# client code to achieve the below.
API code is using the channel very inefficiently – it is opening a connection on the channel, putting a message, closing the channel,
opening the channel again to do the read for the reply and then closing the channel again.
This MUST be changed to open the channel perform its actions and only close the channel after a period of inactivity |
This is happening in the client code. You have to investigate that.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
sathyapbe |
Posted: Tue Apr 17, 2018 3:55 am Post subject: |
|
|
Novice
Joined: 16 Apr 2018 Posts: 21
|
Thanks for the reply!
Yeah, I am seeking the C# client code to retain the channel for a stipulated time. |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Apr 17, 2018 4:50 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
sathyapbe wrote: |
Thanks for the reply!
Yeah, I am seeking the C# client code to retain the channel for a stipulated time. |
Are your apps missing SLA’s? Some other problem? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Apr 17, 2018 5:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sathyapbe wrote: |
Yeah, I am seeking the C# client code to retain the channel for a stipulated time. |
It's called "not closing the channel in your code".
Whatever sample code you've found is doing a single message as an example. You need to examine the code, think about what it's doing and amend yours as appropriate.
There's no additional code to "retain the channel"; I would expect that the sample you're using contains all the necessary code components. Think about this from the perspective of your application writing records to a file, and the sys admins complaining that you're burning I/O by repeatedly getting then dropping the file handle. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
sathyapbe |
Posted: Tue Apr 17, 2018 6:31 am Post subject: |
|
|
Novice
Joined: 16 Apr 2018 Posts: 21
|
That make sense. I will handle it in application level instead of user level. Thank you! |
|
Back to top |
|
 |
RogerLacroix |
Posted: Tue Apr 17, 2018 9:00 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
sathyapbe, to clarify some terms. You don't open a channel, you connect to a queue manager via a channel.
Pseudo code:
- Initialize application
- Connect to queue manager
- Open 1 or more queues (i.e. 1 for input and 1 for output)
- Loop
- - Do something important - business logic
- - Put a message to a queue
- - Get a reply message
- - Do whatever you need to do with the reply message
- EndLoop
- Close queues
- Disconnect from queue manager
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
sathyapbe |
Posted: Tue Apr 17, 2018 9:23 pm Post subject: |
|
|
Novice
Joined: 16 Apr 2018 Posts: 21
|
Its working now. Thank you so much! |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Apr 18, 2018 4:35 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
sathyapbe wrote: |
Its working now. Thank you so much! |
Please share your experience with others. What did you do to fix this? What change(s) did you make? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
sathyapbe |
Posted: Wed Apr 18, 2018 9:19 am Post subject: |
|
|
Novice
Joined: 16 Apr 2018 Posts: 21
|
We have to create the instance for Queue Manager, Request Queue and Response Queue in Global.asax Application_Start(object sender, EventArgs e) method so that this connection open will be treated at Application level(only one connection opened for all the users).
Request Message and Response message instances should be created for each user's session.
Don't forget to close the connection in Global.asax Application_End(object sender, EventArgs e) method. |
|
Back to top |
|
 |
|