Integration of WebLogic and MQ __web

Source: Internet
Author: User
weblogic:8.1 SP2
mq:5.3

Absrtact: Integrating WebLogic with MQ is a valuable application. This article discusses the use of WebLogic's foreign JMS Server configuration Jndi,mdb configuration, which is provided using MQ
Jmsadmin configures MQ Jndi. Also not so detailed, or need the reader to make a small effort.

Key words: jms,weblogic foreign JMS Server,jndi,jmsadmin

Begin:
1, install WebLogic and MQ (nonsense).
2. Configure Jmsadmin (that is, files with no extensions in the java/bin/directory under the MQ installation directory)
Uncomment the next two lines and build the corresponding directory on your machine c:/jndi-directory


Java code:



Initial_context_factory=com. Sun. Jndi. Fscontext. Reffscontextfactory

Provider_url=file:/c:/jndi-directory




The above configuration is appropriate for using file Jndi.
3, configure the MQ Jndi
The following uses Jmsadmin to configure MQ Jndi.
Here are some examples of commands that use Jmsadmin.
In fact, you can go to IBM's website to download the graphics interface, you do not have to remember these commands.
This dongdong is called: Jmsadmingui


Java code:



def QCF (IVTQCF)
def q (IVTQ) Qu (SYSTEM. DEFAULT. Local. QUEUE)
def TCF (IVTTCF)
def t (IVTT) topic (mqjms/psivt/information)





Or you can execute a ivtsetup script to complete a JNDI configuration that you can use.

4, configure the WebLogic foreign jmsserver the following properties to configure:
Java code:


JNDI Initial context factory->com. Sun. Jndi. Fscontext. Reffscontextfactory
JNDI Connection Url->file:/c:/jndi-directory



5. Configure Foreign JMS Connection factories

Code:
Java code:


Local Jndi NAME:MQQCF (name of the JNDI queueconnectionfactory used in WebLogic)
Remote JNDI NAME:IVTQCF (already in the name of º Mei Äjndi configured via Jmsadmin)



6. Configure Foreign JMS destination

Java code:



Local JNDI Name:mqqueue
Remote JNDI NAME:IVTQ




Ditto.
7. MDB configuration



Java code:



<?xml version= "1. 0 "?>
<! DOCTYPE Ejb-jar Public "–//sun Microsystems, Inc.//dtd Enterprise JavaBeans 2.0//en" "http://java.sun.com/dtd/ejb-jar_2 _0.dtd ">
<!--this ejb-jar. XML file defines a message-driven bean called "Simplemdb". It uses container-managed transactions, because ' transaction-type ' is ' container ' and ' trans-attribute ' is ' Required '. -->
<ejb-jar>
<enterprise-beans>
<message-driven>
<ejb-name>ReceiveMessageMDB</ejb-name>
<ejb-class>com. rm. mdb. Receivemessagebean</ejb-class>
<transaction-type> container</transaction-type>
<message-driven-destination>
<!--in WebLogic Server 6. 0, this next parameter is named "Jms-destination-type"-->
<destination-type>javax. Jms. Queue</destination-type>
</message-driven-destination>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>ReceiveMessageMDB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>



Java code:


<?xml version= "1. 0 "encoding=" UTF-8 "?>
<! DOCTYPE Weblogic-ejb-jar Public '-//bea Systems, Inc.//dtd weblogic, 8.1.0 ejb//en ' http://www.bea.com/servers/wls810/ Dtd/weblogic-ejb-jar.dtd ' >
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>ReceiveMessageMDB</ejb-name>
<message-driven-descriptor>
<pool>
<max-beans-in-free-pool> 8</max-beans-in-free-pool>
<initial-beans-in-free-pool> 1</initial-beans-in-free-pool>
</pool>
<destination-jndi-name>MQQUEUE</destination-jndi-name>
<initial-context-factory> WebLogic. Jndi. Wlinitialcontextfactory </initial-context-factory>
&LT;PROVIDER-URL&GT;T3://localhost:7001</provider-url>
<connection-factory-jndi-name>MQQCF</connection-factory-jndi-name>
</message-driven-descriptor>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>




Attention:
If the <trans-attribute>NotSupported</trans-attribute> in Ejb-jar.xml
For required, you need to use xaqueueconnectionfactory.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.