I apologies if I am posting it in a wrong thread, I was not able to locate the exact thread.
I am implementing a java process to post messages to the JMS queue. I need some advise.
I have to post for eg 10 messages to the JMS queue ( its in a loop based on some business condition )
I used service locator design pattern to cache the JNDI lookup for connection factory and queue object since I didnt want to keep creating object from context lookup.
Is there a better way ? I mean do I need rather use IBM-BND-WEB.XMI ?? Does ibm-bnd-web-xmi caches the objects ?
Can someone please share me a code snippet.
Appreciate your response.
Re: JMS Question
So you must be talking about some external client that uses the JNDI Context class to lookup and bind to a REMOTE connection factory, right?
If so - does your solution work? Is it readable? If the answer to both is yes, then your solution is just fine. The last thing you need to be doing is second-guessing yourself, then you'll be asking this question for every decision you make! The trouble with doing that is that you will always get multiple conflicting answers, since deciding what is "better" is highly subjective.