Author |
Message
|
jason_e |
Posted: Mon May 17, 2004 12:08 pm Post subject: Basic JMS Setup |
|
|
Apprentice
Joined: 19 Aug 2003 Posts: 33
|
Hi,
I'm trying to get started with JMS but it is proving to be quite difficult. The Java side of things is quite easy but it is the environment configuration that is given me trouble.
I have read everything in the Java documentation but doesn't help much. Where can I get detailed step-by-step instructions on setting up my JMS environment and running a message listener.
Any links or pointers to specific sections of the documentation would help.
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon May 17, 2004 12:13 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What JMS provider are you using?
WAS? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jason_e |
Posted: Mon May 17, 2004 10:57 pm Post subject: |
|
|
Apprentice
Joined: 19 Aug 2003 Posts: 33
|
Below is the contents of the config file that I use to start JMSAdmin.
I have read through WebSphere MQ - Using Java and it helped me to get
as far as being able to start JMSAdmin. Once I have JMSAdmin started I
don't know what objects to create or how to create them.
Any advice?
#Set the service provider
INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
#Set the initial context
PROVIDER_URL=file:d://jndi
#Set the authentication type
SECURITY_AUTHENTICATION=none |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue May 18, 2004 4:11 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Okay, so you're just using a local file-based JNDI and using MQ itself as the JMS provider.
In order for you to be able to send JMS messages to queues, you have to define Queue destinations for the messages to be put to.
You also have to define a Queue Connection Factory that will allow you to connect to your queue manager.
This is done using the DEFINE command in JMSAdmin. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bower5932 |
Posted: Tue May 18, 2004 5:01 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
There are a couple of publish/subscribe sample programs at:
http://www.developer.ibm.com/tech/sampmq.html
They are called mqjmspub.java and mqjmssub.java. You can also find detailed information on configuring and running them at:
http://www.developer.ibm.com/tech/faq/individual?oid=2:83352
They are geared towards running in a stand-alone environment.
If you are trying to do point-to-point, you can find some samples at the same URL. There will be comments in the headers, but they may not have the detail that you are looking for. One thing that I will add is that you'll need to catch the linked exception:
Code: |
} catch( JMSException je ) {
System.out.println("JMS Exception: " + je);
// check for a linked exception
Exception le = je.getLinkedException();
if (le != null) {
System.out.println("Linked exception: " + le);
}
}
|
This will give you the underlying MQ error. |
|
Back to top |
|
 |
|