ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Channel opening closing type from C# .NET to IBM MQ

Post new topic  Reply to topic
 Channel opening closing type from C# .NET to IBM MQ « View previous topic :: View next topic » 
Author Message
sathyapbe
PostPosted: Mon Apr 16, 2018 11:01 pm    Post subject: Channel opening closing type from C# .NET to IBM MQ Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Apr 17, 2018 2:33 am    Post subject: Re: Channel opening closing type from C# .NET to IBM MQ Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
sathyapbe
PostPosted: Tue Apr 17, 2018 3:55 am    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Tue Apr 17, 2018 4:50 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
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
View user's profile Send private message
Vitor
PostPosted: Tue Apr 17, 2018 5:25 am    Post subject: Reply with quote

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
View user's profile Send private message
sathyapbe
PostPosted: Tue Apr 17, 2018 6:31 am    Post subject: Reply with quote

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
View user's profile Send private message
RogerLacroix
PostPosted: Tue Apr 17, 2018 9:00 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3252
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
View user's profile Send private message Visit poster's website
sathyapbe
PostPosted: Tue Apr 17, 2018 9:23 pm    Post subject: Reply with quote

Novice

Joined: 16 Apr 2018
Posts: 21

Its working now. Thank you so much!
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Apr 18, 2018 4:35 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
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
View user's profile Send private message
sathyapbe
PostPosted: Wed Apr 18, 2018 9:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Channel opening closing type from C# .NET to IBM MQ
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.