-
1. Re: Creation of queues
joelvogt Jul 8, 2002 4:01 AM (in response to vinodhl)hmm, not too sure that would be too good an idea. For what reason do you need the queue to be taken out of the jndi lookup?
-
2. Re: Creation of queues
vinodhl Jul 8, 2002 4:45 AM (in response to vinodhl)I need to move some existing applications into JBoss. It is necessary that there is no chnage required in the JNDI names. Is it possible?
-
3. Re: Creation of queues
nhebert Jul 8, 2002 7:23 AM (in response to vinodhl)Vinodh,
This is where ejb/resource references really come in
handy! If you code your EJBs or Servlets to use the
ENC (Environment Naming Context) by way of java:comp/env
you can write more portable components that do not care
where the physical dependencies are.
At first I really hated moving my JBoss programs to/from
IBM WebSphere (I use JBoss to prototype quickly). I
used to "hard-code" my JNDI references in EJBs and
Servlets to a phyical namespace.After much frustration,
I finally clicked on to using "logical" ejb/resource
references reading (and re-reading) the J2EE spec hoping
there must be some better way then explicit references.
Instead of making JBoss Queues look like WebSphere Queues
(or visa-versa), I just have my EJBs or Servlets lookup
say "java:comp/env/FooQueue" and specify that ENC
(logical or alias) reference in their J2EE standard
Deployment Descriptor!
Then, when I deploy my app to either JBoss or WebSphere
I map that reference to "queue/BarQueue" or whatever I
want that reflects the physical resources in the
deployment environment.
In JBoss, this means adding things like a jboss.xml or
jboss-web.xml to an assembled EAR file to associate the
logical references to physical resources.
Neat stuff really.
As much as I hate to say it, read up on ejb/resources
references in the J2EE 1.2/1.3 spec. It will change
the way you write, assemble and deploy J2EE applications
without pulling your hair out, especially if those
applcations or components move between J2EE application
servers.
Cheers,
Noel. -
4. Re: Creation of queues
vinodhl Jul 24, 2002 6:30 AM (in response to vinodhl)Noel,
Thanks a lot for the help. But there are no eJB's that are being used. It is purely JMS. However the logic can be applied to use a property file or Preference API. Thanks again