简体   繁体   中英

How to connect the queue manager using CCDT file(2063 error) . adding the ChannelDefinitionDirectory in app.config file

Getting error code 2063 while initializing the

MqQueueManager = new MQQueueManager(_queueManagerName, props);

App.config changes:

<section name="CHANNELS" type="System.Configuration.NameValueSectionHandler" />
 <CHANNELS>
    <add key="ChannelDefinitionDirectory" value="C:\filepath\path" />
    <add key="ChannelDefinitionFile" value="ccdtfile.ccdt.TAB" />
  </CHANNELS>

Code changes:

  Hashtable props = new Hashtable();
                props.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);
                Console.WriteLine(_queueManagerName);
                MqQueueManager = new MQQueueManager(_queueManagerName, props);

I think the error might be related to the format of the app.config file. I used the following and was able to connect: Note that configSections must be first element under configuration section.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="CHANNELS" type="System.Configuration.NameValueSectionHandler" />
  </configSections>
  <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
    </startup>
  <CHANNELS>
    <add key="ChannelDefinitionDirectory" value="C:\ProgramData\IBM\MQ\qmgrs\MFTQM\@ipcc" />
    <add key="ChannelDefinitionFile" value="AMQCLCHL.TAB" />
  </CHANNELS>

</configuration>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM