JMS JMSCC3032例外
我使用IBM MQ。我将我的应用程序中的com.ibm.mqmq.mq
jar从7.5升级到9.1.1.0 as:
<groupId>com.ibm.mq</groupId>
<artifactId>com.ibm.mq.allclient</artifactId>
<version>9.1.1.0</version>
我正在从主题接收消息的消费者开始获取错误jmscc0111
。
当我阅读时,这是在8.0版的JMS库中的新行为,默认情况下,JMS ID无法重复使用。 作为解决方案,我将clientId设置为在下面的连接上。我正在从ConnectionFactory
获得连接。
public Connection getConnectionWithUuid() throws JMSException {
Connection connection = connFactory.createConnection();
String uid = UUID.randomUUID().toString();
connection.setClientID(uid);
connection.start();
return connection;
}
现在,我开始获得异常:
JMSCC3032: Resetting the client ID is not allowed.
Connection jmsConnection = null;
Session jmsSession = null;
MessageConsumer consumer = null;
MessageProducer producer = null;
try {
jmsConnection = QueueManager.getInstance().getConnectionWithUuid();
jmsSession = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination responseTopic = QueueManager.getInstance()
.getDestination(this.parameters.getResponseTopicName());
Destination outGoingQueue = QueueManager.getInstance()
.getDestination(this.parameters.getOutGoingQueueName());
consumer = jmsSession.createConsumer(responseTopic);
producer = jmsSession.createProducer(outGoingQueue);
TextMessage requestMessage = jmsSession.createTextMessage(request);
requestMessage.setJMSCorrelationID(parameters.getSessionId());
producer.send(requestMessage);
logMessage("OutGoing Message:\n", requestMessage);
String response = null;
long begin = System.currentTimeMillis();
while (response == null && System.currentTimeMillis() - begin < protocolTimeoutSecs * 1000) {
Message responseMessage = consumer.receive(protocolTimeoutSecs * 1000);
在最后一行(computer.receive
)上抛出jmscc3032
。
I use IBM MQ. I upgraded the com.ibm.mq
jar in my application from 7.5 to 9.1.1.0 as:
<groupId>com.ibm.mq</groupId>
<artifactId>com.ibm.mq.allclient</artifactId>
<version>9.1.1.0</version>
My consumer that is receiving messages from topic started to get error JMSCC0111
.
As I read this is new behavior in the JMS libraries above version 8.0 where by default a JMS ID can not be reused.
As a solution I set clientId on connection as below. I'm getting connection from ConnectionFactory
.
public Connection getConnectionWithUuid() throws JMSException {
Connection connection = connFactory.createConnection();
String uid = UUID.randomUUID().toString();
connection.setClientID(uid);
connection.start();
return connection;
}
Now I started to get exception:
JMSCC3032: Resetting the client ID is not allowed.
Connection jmsConnection = null;
Session jmsSession = null;
MessageConsumer consumer = null;
MessageProducer producer = null;
try {
jmsConnection = QueueManager.getInstance().getConnectionWithUuid();
jmsSession = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination responseTopic = QueueManager.getInstance()
.getDestination(this.parameters.getResponseTopicName());
Destination outGoingQueue = QueueManager.getInstance()
.getDestination(this.parameters.getOutGoingQueueName());
consumer = jmsSession.createConsumer(responseTopic);
producer = jmsSession.createProducer(outGoingQueue);
TextMessage requestMessage = jmsSession.createTextMessage(request);
requestMessage.setJMSCorrelationID(parameters.getSessionId());
producer.send(requestMessage);
logMessage("OutGoing Message:\n", requestMessage);
String response = null;
long begin = System.currentTimeMillis();
while (response == null && System.currentTimeMillis() - begin < protocolTimeoutSecs * 1000) {
Message responseMessage = consumer.receive(protocolTimeoutSecs * 1000);
On the last line (consumer.receive
) it throws JMSCC3032
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论