我在将Spring Boot应用程序连接到icp上的mq时遇到问题,因此如何定义ibm.mq.connName=mymq-ibm-mq(30803)
,因为我总是得到此执行:
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9204: Connection to host ‘10.0.0.1(1414)’ rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2538;AMQ9213: A communications error for ‘TCP’ occurred. [1=java.net.ConnectException[Connection refused (Connection refused)],3=connnectUsingLocalAddress,4=TCP,5=Socket.connect]],3=10.0.0.1(1414),5=RemoteTCPConnection.connnectUsingLocalAddress]
我如何获得正确的主机和端口?
这是我的application.properties:
ibm.mq.queueManager=QM1
ibm.mq.channel=DEV.ADMIN.SVRCONN
ibm.mq.connName=mymq-ibm-mq(30803)
ibm.mq.user=admin
ibm.mq.password=passw0rd
这是kubectl describe service的输出
Name: mymq-ibm-mq
Namespace: lab
Labels: app=ibm-mq
chart=ibm-mqadvanced-server-dev
heritage=Tiller
release=mymq
Annotations:
Selector: app=ibm-mq,release=mymq
Type: NodePort
IP: 10.1.0.24
Port: console-https 9443/TCP
TargetPort: 9443/TCP
NodePort: console-https 32575/TCP
Endpoints: 10.2.9.53:9443
Port: qmgr 1414/TCP
TargetPort: 1414/TCP
NodePort: qmgr 30803/TCP
Endpoints: 10.2.9.53:1414
Session Affinity: None
External Traffic Policy: Cluster
答案 0 :(得分:1)
我非常确定MQ连接端口应该是1414,而不是30803。尝试以下操作:
ibm.mq.connName=mymq-ibm-mq(1414)