Author |
Message
|
fredand44 |
Posted: Mon Feb 20, 2006 7:22 am Post subject: How to connect to MQ from WebLogic? |
|
|
Acolyte
Joined: 14 Feb 2006 Posts: 63
|
Hello!
We are now trying to connect to MQ from WebLogic. The image at this url describes our system:
http://www.dsv.su.se/~fr-ander/images/Overview.jpg
The green items relies at WebSphere
The orange items relies at MQ
The gray items relies at WebLogic
We send messages from WebSphere (jms/WSQueue) to the queue MQQueue inside MQ. This works fine. Now we need to read those messages from WebLogic (wls.MQQueueRec).
I guess that the secret to connect to MQ from WebLogic relies in the item Bridge destination IBMMQSource. Correct me if I'm wrong!!!
I guess we have set up the system correct with the JMSAdmin tool.
def qcf(MQ_QCF) qmanager(QM_inv1437) host(inv1437) port(1414) transport(client)
def q(MQQueueRec) queue(MQQueueRec) qmanager(QM_inv1437)
def q(MQQueueSend) queue(MQQueueSend) qmanager(QM_inv1437)
I guess all depends on the mapping of name, correct me if I'm wrong here. So we have test some different settings of the IBMMQSource item as you can see in the image.
So if you see anything wrong please let us know!
Best regards
Fredrik |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 20, 2006 7:26 am Post subject: Re: How to connect to MQ from WebLogic? |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
fredand44 wrote: |
Hello!
We are now trying to connect to MQ from WebLogic. The image at this url describes our system:
http://www.dsv.su.se/~fr-ander/images/Overview.jpg
The green items relies at WebSphere
The orange items relies at MQ
The gray items relies at WebLogic
We send messages from WebSphere (jms/WSQueue) to the queue MQQueue inside MQ. This works fine. Now we need to read those messages from WebLogic (wls.MQQueueRec).
I guess that the secret to connect to MQ from WebLogic relies in the item Bridge destination IBMMQSource. Correct me if I'm wrong!!!
I guess we have set up the system correct with the JMSAdmin tool.
def qcf(MQ_QCF) qmanager(QM_inv1437) host(inv1437) port(1414) transport(client) Channel=??
def q(MQQueueRec) queue(MQQueueRec) qmanager(QM_inv1437)
def q(MQQueueSend) queue(MQQueueSend) qmanager(QM_inv1437)
I guess all depends on the mapping of name, correct me if I'm wrong here. So we have test some different settings of the IBMMQSource item as you can see in the image.
So if you see anything wrong please let us know!
Best regards
Fredrik |
_________________ MQ & Broker admin |
|
Back to top |
|
 |
fredand44 |
Posted: Fri Feb 24, 2006 7:19 am Post subject: |
|
|
Acolyte
Joined: 14 Feb 2006 Posts: 63
|
Hello!
What kind of channel should it be?
Sender channel
Receiver channel
Server connection channel
....
Best regards
Fredrik |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Feb 24, 2006 7:24 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What kind of connection are you making? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fredand44 |
Posted: Fri Feb 24, 2006 7:42 am Post subject: |
|
|
Acolyte
Joined: 14 Feb 2006 Posts: 63
|
We have tried to set up this into the weblogic jndi-context:
def qcf(QM_inv1437) qmanager(QM_inv1437) host(inv1437) port(1414) transport(client) channel(MQToWLsc)
def q(MQToWL) queue(MQToWL) qmanager(QM_inv1437)
Both with JMSAdmin using:
PROVIDER_URL=t3://Inv1437:7010/
INITIAL_CONTEXT_FACTORY=weblogic.jndi.WLInitialContextFactory
and
PROVIDER_URL=file://inv1437/C:/JNDI-Directory
com.sun.jndi.fscontext.RefFSContextFactory
Inside the JMS Bridge Destination we use theses settings for Connection URL depending on how we set the jndicontext:
t3://Inv1437:7010/
file://inv1437/C:/JNDI-Directory
or even
file://inv1437/C:/JNDI-Directory/.bindings
But the brige only get this state:
WARN: failed to connect to the source.
The source resides in MQ.
Do you see anything wrong?
Best regards
Fredrik
the channel MQToWLsc uses port 1414 and is a sender channel.
Do you see anything wrong |
|
Back to top |
|
 |
fredand44 |
Posted: Fri Feb 24, 2006 7:44 am Post subject: |
|
|
Acolyte
Joined: 14 Feb 2006 Posts: 63
|
[quote="jefflowrey"]What kind of connection are you making?[/quote]
Hmm!
I guess I would say it is a Sender from MQ to WebLogic.
The connection is a Messaging Bridge set up inside weblogic.
Hope this was the answer you asked for.
Best regards
Fredrik |
|
Back to top |
|
 |
skn |
Posted: Fri Feb 24, 2006 7:50 am Post subject: |
|
|
 Centurion
Joined: 21 May 2003 Posts: 112 Location: Dallas
|
Quote: |
I guess I would say it is a Sender from MQ to WebLogic. |
Wouldnt that be a client connection from weblogic? from
Quote: |
def qcf(QM_inv1437) qmanager(QM_inv1437) host(inv1437) port(1414) transport(client) channel(MQToWLsc) |
|
|
Back to top |
|
 |
fredand44 |
Posted: Fri Feb 24, 2006 7:51 am Post subject: |
|
|
Acolyte
Joined: 14 Feb 2006 Posts: 63
|
I guess so!
Does it matter?
/Fredrik |
|
Back to top |
|
 |
skn |
Posted: Fri Feb 24, 2006 7:57 am Post subject: |
|
|
 Centurion
Joined: 21 May 2003 Posts: 112 Location: Dallas
|
Quote: |
But the brige only get this state:
WARN: failed to connect to the source. |
I guess thats from the web admin console.Do you see anything in the command window from where you start the WL server or domain.That might give more info as to why it failed.If not try setting the debug mode to"on" and restart the server. |
|
Back to top |
|
 |
fredand44 |
Posted: Fri Feb 24, 2006 8:06 am Post subject: |
|
|
Acolyte
Joined: 14 Feb 2006 Posts: 63
|
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Feb 24, 2006 8:10 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
fredand44 wrote: |
I guess so!
Does it matter? |
Yes. It entirely matters. Client connections use one channel pair. It is a "CLIENT CONNECTION" channel on the client side that hooks up to a SERVER CONNECTION channel on the server. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
skn |
Posted: Fri Feb 24, 2006 8:37 am Post subject: |
|
|
 Centurion
Joined: 21 May 2003 Posts: 112 Location: Dallas
|
What about the output for the server where you have this bridge deployed.I dont see any mention of messagebridge in the console output you listed.
DO you have the IBM jar files for Java clients on the weblogic system? |
|
Back to top |
|
 |
fredand44 |
Posted: Fri Feb 24, 2006 11:01 am Post subject: |
|
|
Acolyte
Joined: 14 Feb 2006 Posts: 63
|
[quote="jefflowrey"]Yes. It entirely matters. Client connections use one channel pair. It is a "CLIENT CONNECTION" channel on the client side that hooks up to a SERVER CONNECTION channel on the server.[/quote]
Hmm?
That means that there must be a channel from weblogic and one channel from MQ pointing to each other.
On those examples I have found for creating a bridge I have not seen anything about necessary channel setting when setting up the bridge. My guess is that all this set up for channels occurs when you create a bridge, but behind the sceens. But it would feel good if I have to set them my self.
If my guess is wrong, do you know how I mange to create the channels for both weblogic and mq pointing to each others?
Best regards
Fredrik |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Feb 24, 2006 11:11 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
fredand44 wrote: |
jefflowrey wrote: |
Yes. It entirely matters. Client connections use one channel pair. It is a "CLIENT CONNECTION" channel on the client side that hooks up to a SERVER CONNECTION channel on the server. |
Hmm?
That means that there must be a channel from weblogic and one channel from MQ pointing to each other. |
No.
It means that the channel has two ends, and a different definition for each end. Just like a Sender/Receiver pair is *one* channel, that has two ends and a different definition on each side. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Feb 24, 2006 12:11 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
fredand44 wrote: |
We have tried to set up this into the weblogic jndi-context:
def qcf(QM_inv1437) qmanager(QM_inv1437) host(inv1437) port(1414) transport(client) channel(MQToWLsc) |
Good ! This looks consistent.
Note that with client transport you cannot do a multiphase commit unless you use the transactional client.
fredand44 wrote: |
def q(MQToWL) queue(MQToWL) qmanager(QM_inv1437)
Both with JMSAdmin using:
PROVIDER_URL=t3://Inv1437:7010/
INITIAL_CONTEXT_FACTORY=weblogic.jndi.WLInitialContextFactory
and
PROVIDER_URL=file://inv1437/C:/JNDI-Directory
com.sun.jndi.fscontext.RefFSContextFactory |
You should not have to do anything of the kind.
If your JNDI from the file context is added to the initial context in WL you only should have to ask for it:
Code: |
Context ctx = new InitialContext();
QueueConnectionFactory qcf = (QueueConnectionFactory) ctx.lookup("myMQqcf");
// as specified in the WL bindings to the file context |
Never seen the url where you get down to .bindings. The correct url would be "file://inv1437/C:/JNDI-Directory" but then the correct factory would be the one referencing sun file system.... and not t3://Inv1437:7010...
Here you cannot mix. You should go the full WL way but then all you probably need to reference is the way I showed in the code above.
Remember JNDI names should be unique within their expanded scope.
fredand44 wrote: |
But the brige only get this state:
WARN: failed to connect to the source.
The source resides in MQ.
Do you see anything wrong?
Best regards
Fredrik
the channel MQToWLsc uses port 1414 and is a sender channel.
Do you see anything wrong |
See my comments in the text. _________________ MQ & Broker admin |
|
Back to top |
|
 |
|