Author |
Message
|
calimero |
Posted: Mon Jan 09, 2006 1:34 pm Post subject: Receive MQ message from Websphere MQ to Weblogic 8.1 |
|
|
Newbie
Joined: 09 Jan 2006 Posts: 8 Location: Paris
|
I want to receive a message from a Websphere MQ client in my Queue Connection Factory (QCF) on Weblogic 8.1. But I read that I must convert my QCF to a Queue Manager for that work. So is it possible to do that without a Websphere MQ Licence ? Or is there any other solution ?
For example, is it possible to indicate Websphere MQ a QCF in place of a Queue manager ? (At this point I couldn't succed that)
Thanks a lot for the help.
NB : The Websphere MQ client can only send MQ message and not JMS |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jan 09, 2006 2:00 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Your question is very badly formed.
There is nothing to get messages from if there is not an MQ Queue Manager somewhere. The MQ client has to have a Queue Manager to connect to.
It is not possible to get an MQ Queue Manager without paying for a license for MQServer.
You should not need to use the MQQueueManager class in the WebSphere MQ API for Java - you should be able to use the QCF just fine.
There are apparently specific instructions in the WebLogic documentation for how to configure MQ as a foreign JMS provider in WebLogic. There was a message posted here somewhere (by Roger LaCroix, if I recall correctly) that included a link to that documentation. Maybe if you used the Search button to look for "JMS WebLogic" you could find it again.
I think WebLogic has it's own JMS Provider, that you could use instead of WebSphere MQ. But you won't get much help with that here, I think. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
calimero |
Posted: Mon Jan 09, 2006 2:18 pm Post subject: |
|
|
Newbie
Joined: 09 Jan 2006 Posts: 8 Location: Paris
|
First, thanks a lot for the answer, and sorry if I wasn't clear (actually I am french )
In fact I should develop a queue on Weblogic platform that received MQ Messages from Websphere MQ (that I can't modify), so I can't configure Websphere to send JMS, but I read that MQ message is very close to JMS, am I wrong ?
But maybe there is no solution to that
I fear that as you said, I must buy a Websphere MQ. I am going to search for the topic that you mentionned
Thanks again |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jan 09, 2006 2:26 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
If it is just for testing purpose there is a trial version valid only x days.
You could download that.
Bonne Chance  _________________ MQ & Broker admin |
|
Back to top |
|
 |
calimero |
Posted: Mon Jan 09, 2006 2:39 pm Post subject: |
|
|
Newbie
Joined: 09 Jan 2006 Posts: 8 Location: Paris
|
Merci beaucoup !
unfortunately, it is not only for testing, but for production tools
And in the bea document precedently quoted (that I indeed found in a rogerLacroix post ), there is a tutorial for connecting Weblogic and Websphere MQ. I also saw that I need the IBM tool JMSadmin for convert a Queue Connection Factory to a Queue Manager. So I think that Websphere Licence is necessary.
I already downloaded a Websphere trial version, but I never used Websphere before, and I even couldn't succeed a connection between 2 Websphere MQ
I will test all that tomorrow because it is late here
Thanks again ! |
|
Back to top |
|
 |
colincrist |
Posted: Tue Jan 10, 2006 6:55 am Post subject: |
|
|
Novice
Joined: 24 Feb 2004 Posts: 22
|
|
Back to top |
|
 |
calimero |
Posted: Tue Jan 10, 2006 7:23 am Post subject: |
|
|
Newbie
Joined: 09 Jan 2006 Posts: 8 Location: Paris
|
Ok, but unfortunatly, the Websphere client that connecting to my Queue on Weblogic, doesn't do that with JMS but with MQMessage, and the tools that you mentioned, are only based on JMS, isn't it ?
After research, I see that a java class of IBM allow to create MQQueueManager Object, but it seems that it doesn't work on Weblogic platform (it throw a java.lang.NoSuchFieldError with the message : msgToken) |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jan 10, 2006 7:33 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Okay.
You're not using JMS at all.
Then don't bother with JNDI or JMS Providers.
You should look at the example code for the WebSphere MQ API for Java, which includes MQQueueManager and etc, and build a client connection using connection information in MQEnvironment.
If you are having trouble getting the WebSphere MQ API for Java to work in WebLogic, maybe you don't have the right classes on the classpath or similar, or you haven't installed a full MQ Client on the machine.
Can you post a section of your code and indicate what error you get, and where? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
calimero |
Posted: Tue Jan 10, 2006 7:33 am Post subject: |
|
|
Newbie
Joined: 09 Jan 2006 Posts: 8 Location: Paris
|
hummmm... finally, maybe your Hermes tool can do what I need , I just saw a tutorial on your website that is quite simple and good, I download it for test
EDIT :
For precising my problem :
We are working with another Firm. This one only use MQSERIES (websphere)
But on our side, we working on JMS (weblogic)
I want to know if your tool (Hermes) allow a JMS queue (Queue Connection Factory) looks like a Queue Manager ? |
|
Back to top |
|
 |
calimero |
Posted: Tue Jan 10, 2006 8:24 am Post subject: |
|
|
Newbie
Joined: 09 Jan 2006 Posts: 8 Location: Paris
|
What, exactly, is the WebSphere MQ API ? Is it the MA88 pac that contain the com.ibm.mq.jar file ?
My code is very simple, because I just want to create a Queue Manager on Weblogic (for this time)
Code: |
import com.ibm.mq.MQQueueManager;
import com.ibm.mq.jms.MQQueueConnection;
import com.ibm.*;
import com.ibm.mq.MQC;
import com.ibm.mq.MQEnvironment;
import com.ibm.mq.MQException;
import com.ibm.mq.MQGetMessageOptions;
import com.ibm.mq.MQMessage;
import com.ibm.mq.MQPutMessageOptions;
import com.ibm.mq.MQQueue;
public class testMQ
{
public static void main(String args[])
{
qManager = "testQ";
try{
MQQueueManager qMgr = new MQQueueManager(qManager);
}
catch (Exception e){}
}
}
|
I think the classpath is correctly configured because weblogic act as it knows the MQQueueManager class, but maybe it require another lib that I don't have.
So, this code launch a java.lang.NoSuchFieldError as I mentionned previously.
Therefore, I test a quit simple IBM class, but it produce the same Exception. This is the class :
Code: |
import java.io.*;
import java.lang.*;
import java.io.*;
import java.net.*;
import java.util.*;
import com.ibm.mq.*; // Include the MQ package
//import mq.*;
//import com.tandem.tmf.Current; // NSK-only: JTS Current Class
public class MQSample
{
private static String qManager = "CONFUSE"; // define name of queue manager object to
// connect to.
//private static Current transact = new Current(); // NSK: Create a JTS transaction object
private static MQQueueManager qMgr; // define a queue manager object
// When the class is called, this initialisation is done first.
public static void main(String args[])
{
System.out.println("MQSample: Java Application sample");
try {
// Create a connection to the queue manager
qMgr = new MQQueueManager(qManager);
// Set up the options on the queue we wish to open...
// Note. All MQ Options are prefixed with MQC in Java.
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF |
MQC.MQOO_OUTPUT ;
// Now specify the queue that we wish to open, and the open options...
MQQueue system_default_local_queue =
qMgr.accessQueue("SYSTEM.DEFAULT.LOCAL.QUEUE",
openOptions,
null, // default q manager
null, // no dynamic q name
null); // no alternate user id
// Define a simple MQ message, and initialise it in UTF format..
MQMessage hello_world = new MQMessage();
hello_world.writeUTF("Hello World!");
// specify the message options...
MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the defaults, same
// as MQPMO_DEFAULT constant
// put the message on the queue
system_default_local_queue.put(hello_world,pmo);
// get the message back again...
// First define a MQ message buffer to receive the message into..
MQMessage retrievedMessage = new MQMessage();
retrievedMessage.messageId = hello_world.messageId;
// Set the get message options..
MQGetMessageOptions gmo = new MQGetMessageOptions(); // accept the defaults
// same as MQGMO_DEFAULT
gmo.options = MQC.MQGMO_SYNCPOINT;
// get the message off the queue.. under syncpoint
// NSK: Start a new transaction
// transact.begin();
system_default_local_queue.get(retrievedMessage,
gmo,
100); // max message size
// And prove we have the message by displaying the UTF message text
String msgText = retrievedMessage.readUTF();
System.out.println("The message is: " + msgText);
// NSK: Commit the transaction
//transact.commit(true);
// Close the queue
system_default_local_queue.close();
// Disconnect from the queue manager
qMgr.disconnect();
}
// If an error has occured in the above, try to identify what went wrong.
// Was it an MQ error?
catch (MQException ex)
{
System.out.println("An MQ error occurred : Completion code " +
ex.completionCode +
" Reason code " + ex.reasonCode);
}
// Was it a Java buffer space error?
catch (java.io.IOException ex)
{
System.out.println("An error occurred whilst writing to the message buffer: " +
ex);
}
} // end of start
} // end of sample
|
|
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jan 10, 2006 8:29 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The WebSphere MQ API for Java is the name for the replacement for MA88 that is shipped and maintained as part of the MQ package.
It's the base Java API - what you're using.
But you should not be using MA88. You should install the Java API from a client package.
This is either in a separate fileset or a custom option in the Client installer (depending on your os and packaging). _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
colincrist |
Posted: Tue Jan 10, 2006 8:32 am Post subject: |
|
|
Novice
Joined: 24 Feb 2004 Posts: 22
|
Hi,
WRT ServiceMix and Mule (i.e. using a EAI broker), you may be confused (or I may be confused in what you're asking). The flow would be:
1. MQClient (plain Java or JMS) writes message to queue A
2. EAI broker reads message from queue A
3. EAI broker copies message, you can do transform or other stuff here.
4. EAI broker writes message to WebLogic queue B
5. WebLogic MDB or whatever reads the message from B
There are other ways to do this with other products, this is just one way.
Colin
http://hermesjms.com |
|
Back to top |
|
 |
calimero |
Posted: Tue Jan 10, 2006 8:59 am Post subject: |
|
|
Newbie
Joined: 09 Jan 2006 Posts: 8 Location: Paris
|
colincrist wrote: |
Hi,
WRT ServiceMix and Mule (i.e. using a EAI broker), you may be confused (or I may be confused in what you're asking). The flow would be:
1. MQClient (plain Java or JMS) writes message to queue A
2. EAI broker reads message from queue A
3. EAI broker copies message, you can do transform or other stuff here.
4. EAI broker writes message to WebLogic queue B
5. WebLogic MDB or whatever reads the message from B
There are other ways to do this with other products, this is just one way.
Colin
http://hermesjms.com |
Hi
First, thanks a lot for the answers.
I have several questions about that :
- Is Hermes the EAI broker ?
- For our project, the queue A must be a Queue Manager, as a Websphere Object
So can we do this with Hermes ?
Therefore, actually I couldn't launch Hermes on Windows, it said "could not find the main class. Program will exit ", neither on Linux (Redhat), it said :
This script is a placeholder for the /usr/bin/java and /usr/bin/javac
master links required by jpackage.org conventions. libgcj's
rmiregistry, rmic and jar tools are now slave symlinks to these
masters, and are managed by the alternatives( system.
This change was necessary because the rmiregistry, rmic and jar tools
installed by previous versions of libgcj conflicted with symlinks
installed by jpackage.org JVM packages.
Do you know, if I miss one thing ? |
|
Back to top |
|
 |
colincrist |
Posted: Tue Jan 10, 2006 9:18 am Post subject: |
|
|
Novice
Joined: 24 Feb 2004 Posts: 22
|
Either your english is a confusing me or you misunderstand some concepts here but I'll see what I can do to answer:
> - Is Hermes the EAI broker ?
Hermes is a GUI for using JMS.
ServiceMix and MULE are EAI brokers.
>- For our project, the queue A must be a Queue Manager, as a Websphere > Object
> So can we do this with Hermes ?
I've got no idea what you mean by this.
> Therefore, actually I couldn't launch Hermes on Windows, it said "could not find the main class. Program will exit ", neither on Linux (Redhat), it said :
Read the Hermes release notes - it only works on a 1.5 JVM and your redhat problem is that you've got no Java installed or not installed properly....
Colin.
http://hermesjms.com |
|
Back to top |
|
 |
calimero |
Posted: Tue Jan 10, 2006 9:34 am Post subject: |
|
|
Newbie
Joined: 09 Jan 2006 Posts: 8 Location: Paris
|
Ok, so Hermes shouldn't be useful for our problem, because we must supply a Queue Manager to our partner, and not JMS
For the error with Hermes, I have already read the install note, and the jvm on my computer is the 1.5.
Thanks a lot for the answer. |
|
Back to top |
|
 |
|