当我从非持久主题订阅者切换到持久主题订阅者时,我无法查找之前可以阅读的主题名称(使用JNDI)。
在查找主题时,管理控制台出错:
An error occurred during activation of changes, please see the log for details.
ERROR: Could not activate itft-jmsmodule!ITFT-JMS-1@ItftTopic
The Messaging Kernel ITFT-JMS-1 has not yet been opened
我正在使用Oracle WebLogic Server管理控制台来设置WebSphere队列。在控制台上,我做了这些更改:
ItftFileStore
ItftFileStore
Store Enabled
字段。Delivery Mode Override
更改为Persistent
。这是我正在运行的代码。有相关内容有一些评论。
public void start() throws Exception {
try {
LOG.info("Starting the FC MQ message consumer / listener ...");
InitialContext initialContext = getInitialContext();
topicConnectionFactory = (TopicConnectionFactory) initialContext.lookup(jmsFactory);
topicConnection = topicConnectionFactory.createTopicConnection();
topicConnection.setClientID(clientId);
LOG.info("1"+topicConnection.getClientID());
topicSession = topicConnection.createTopicSession(false, Session.CLIENT_ACKNOWLEDGE);
LOG.info("2"+topicConnection.getClientID());
//topicConnection.setExceptionListener(connectionExceptionListener);
jmsTopic = (Topic) initialContext.lookup(topic); // Error being thrown here
LOG.info("3"+topicConnection.getClientID());
//topicSubscriber = topicSession.createSubscriber(jmsTopic); // Works as a non-durable subscriber
topicSession.createDurableSubscriber(jmsTopic,subscriberName);
LOG.info("4"+topicConnection.getClientID());
topicSubscriber.setMessageListener(messageListener);
topicConnection.start();