How to specify the location of the WebSphere MQ feed table for a .net web application using web.config

I have already gathered several times in circles about this. I am trying to connect to the distributed queue manager using the provided channel table file. I can make this work if I point to the environment variable MQCHLLIB and MQCHLTAB on my server. However, the IBM documentation states that the .net configuration file may override these variables.

Here is what I put in my web.config file:

... <configSections> <section name="CHANNELS" type="System.Configuration.NameValueSectionHandler" /> </configSections> <CHANNELS> <add key="ChannelDefinitionDirectory" value="C:\temp"></add> <add key="ChannelDefinitionFile" value="DSM_MOM_TEST.tab"></add> </CHANNELS> ... 

And here is the code that runs:

 Hashtable properties = new Hashtable(); //Add managed connection type to parameters. const String connectionType = MQC.TRANSPORT_MQSERIES_CLIENT; properties.Add(MQC.TRANSPORT_PROPERTY, connectionType); return new MQQueueManager(queueManagerName, properties); 

queueManagerName is set to the general queue manager "* Q101T".

However, this does not work, and I get an error: 2058 MQRC_Q_MGR_NAME_ERROR

I was unable to find additional documentation on how to make this work, other than environment variables, and the standard mqclient.ini should be overridden by the line of channels in the web.config file.

Is there something I missed in the code? Any advice would be greatly appreciated.

Edit: I changed connectionType to MQC.TRANSPORT_MQSERIES_MANAGED and I overcame the error I was getting. However, now I get an I / O error:

Error System.IO.IOException was not processed user code Message = "I / O error" Source = "amqmdnet"
Stack Traces: in IBM.WMQ.MQChannelTable.CreateChannelEntryLists (MQChannelListEntry list names)

I think this is most likely due to https://www-304.ibm.com/support/docview.wss?uid=swg1IC69174 , so I'm now waiting from middleware partners to make sure this is the case hopefully provide me a new .TAB file ...

Edit2 It seems like this is not a problem. I started the MQ trace and made a mistake because it could not find the AMQCLCHL.TAB file. I do not understand why it is still looking for this file. It should use the feed table specified in my web.config. Does anyone know why he does not raise these values?

+4
source share
1 answer

. The .Net configuration file is used only for types of managed client connections, so switching to managed mode is definitely a step in the right direction. Now the question is whether the application really works in controlled mode. There is a decision tree described in Defining a Connection Type for Use in the Infocenter Section. Note that there are times when a managed connection may return to an unmanaged connection. I would suggest running this section to find out if any of these cases apply.

Alternatively, try setting the feed table in the mqclient.ini file. This value is used if it is not overridden by the .Net configuration file. If setting the value here works, then this confirms that the values ​​in the .Net configuration file are ignored, apparently because the application is running in unmanaged mode.

0
source

Source: https://habr.com/ru/post/1335421/


All Articles