【问题标题】:Jython script to modify queue connection factories用于修改队列连接工厂的 Jython 脚本
【发布时间】:2022-10-05 16:18:27
【问题描述】:

我已经在 websphere 的队列连接工厂中配置了队列管理器 当前设置未启用 SSL。

我想启用这两件事

  • 使用 SSL 保护与 IBM MQ 的通信
  • 指定要使用的 SSI

需要您的帮助才能通过 jython 编辑这些内容

    标签: websphere jython


    【解决方案1】:

    使用modifyWMQConnectionFactory 命令执行此任务。

    请参见下面的示例:

    #Set QCF Name
    qcfName='MYQCF'
    
    #Set custom SSL config name
    sslConfig='CUSTOMSSLSettings'
    
    #Get the list of all QCF's in the environment
    qcfList=AdminConfig.list('MQQueueConnectionFactory').splitlines()
    
    #You can futher refine this command and restrict the query to a specific resource scope 
    #eg: qcfList=AdminConfig.list('MQQueueConnectionFactory', clusterId).splitlines()
    
    #Iterate the list and update the config for MYQCF
    for qcf in qcfList:
        if qcfName == AdminConfig.showAttribute(qcf, 'name'):
            print 'Enable SSL config for QCF: '+qcfName+' and use '+sslConfig+' SSL configuration'
            AdminTask.modifyWMQConnectionFactory(qcf, '[-sslType SPECIFIC -sslConfiguration '+sslConfig+']')
        else:
            print 'Skip SSL config update for QCF: '+AdminConfig.showAttribute(qcf, 'name')
    
    #save the changes
    AdminConfig.save()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-05
      • 1970-01-01
      • 2017-09-04
      • 1970-01-01
      • 2021-05-10
      • 2014-11-16
      相关资源
      最近更新 更多