what is the benefit of using JNDI for the JMS connection setup

Hi @rayleeustc_ll,
Great question! The benefit of using JNDI is essentially to not hard code items that may differ per environment. By using JNDI to look up your JMS objects (such as Connection Factory and Destinations) it allows for these JMS objects to be tuned on an environment by environment, or broker by broker basis without you needing to change the code. This gives your solace (or other JMS provider) administrators the flexibility to create and configure these objects based on the resources available to them while allowing your app to be portable between objects. For example, your app just tries to lookup the “MY.QUEUE” queue via JNDI and doesn’t need to know its access type, message quota, max consumer count, or many other things that the administrator can tune under the covers.

-Marc