非永続トピック サブスクライバーから永続トピック サブスクライバーに切り替えると、以前は (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
- 永続ストアの場合、[構成] タブで、ディレクトリを追加しました。
- JMS サーバーの場合、[構成] -> [一般] タブで、永続ストアを次のように変更しました。
ItftFileStore
- JMS サーバーの場合、[構成] -> [一般] タブ -> [詳細設定] で、
Store Enabled
フィールドをオンにしました。 - ItftTopic については、[構成] -> [オーバーライド] タブを に変更
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();