Migrating from IBM MQ to javax.jms.* (Weblogic)

拥有回忆 提交于 2019-12-12 21:15:21

问题


I've been looking for days about how one could migrate from using IBM Websphere MQ to rather only using the QueueManager within Weblogic 10.3.x server. This would save cost of licenses for IBM MQ. The closest I came was finiding an external link which stated that IBM examples existed that did something similar(moving away from MQ to standard jms libraries), but when I attempted to follow the link: http://www.developer.ibm.com/isv/tech/sampmq.html it lead to a dead page :\

More specifically I am interested in

  1. What classes to use in my attempts to replace the following, com.ibm.mq.* classes:
    • MQEnvironment
    • MQQueueManager
    • MQGetMessageOptions
    • MQPutMessageOptions
    • and other classes which don't have an obvious javax.jms.* alternative.
  2. Some of the nuances & work-arounds I may encounter in this migration process.

The database we are forwarding the queue messages to is Oracle 11 Standard (with advanced queuing) if that changes anything, so basically we are looking to "cut out the middle-man", so to speak. Your learned responses will be highly appreciated!


回答1:


You seem to use the MQI api for MQ, to which there is no replacement at hand. There is no other way than to actually rewrite your MQ application logic to use the JMS API.

A good way might be to first migrate into JMS using the same WebSphere MQ server, since it allows you to verify your results in a reliable way.

You ask for what classes to replace say MQGetOptions with. There are no single 1-to-1 replacement (there are even some aspects of MQI that JMS cannot easily replace). Most of the MQPutOptions and other options are available by setting parameters on sessions and messages in JMS. You really need to understand the JMS api before trying this switch.

Then, when you have jms working with WebSphere MQ, you can do as Beryllium suggests, but swapping the libraries to Weblogic, switch any reference to com.ibm.mq.jms.MQConnectionFactory;, configuring the new parameters and pray to any a available god - press run :)




回答2:


I have completed an application which supported both JBossMQ and MQSeries/WebSphere MQ.

The MQSeries specific classes I required were

import com.ibm.mq.jms.JMSC;
import com.ibm.mq.jms.MQConnectionFactory;
import com.ibm.mq.jms.MQQueueConnectionFactory;
import com.ibm.mq.jms.MQTopicConnectionFactory;

These were sufficient to create the javax.jms.QueueConnection/TopicConnection.

As for WebSphere MQ, I connected directly. As for JBossMQ I looked up the factories using JNDI.

So on top of this there is only JMS.

  1. So the first step is to rewrite your application so that only the initializing part uses WebSphere MQ specific classes (the ones I have listed above)

  2. Replace the remaining MQ specific part with a JNDI/directory lookup for a queue connection factory provided by your application server

  3. Remove the MQ series specific parts from your source.

Here is a simple example which shows how to send a message.



来源:https://stackoverflow.com/questions/16856662/migrating-from-ibm-mq-to-javax-jms-weblogic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!