Can I use the JNDI SPI within a custom ESB service?

Posted by teeljb on 26-Jan-2012 09:14

In the back of the MQ Application Programming Guide it provides direction and examples to programmatically access the internal JNDI store. Is there any problem or restriction to using this technique within a custom ESB service? I'd like to invoke it during the service xq_init method, to populate a static table for later lookups.

Thanks,

Jim

All Replies

Posted by kjervis on 26-Jan-2012 18:25

Hi Jim,

It sounds like as part of your Service initialisation you are going to resolve and cache locally any JNDI destinations lookups.  There should be no issue with leveraging the Sonic MQ API calls in order to do this.

You will need to ensure the Sonic Client library JAR files are included on your Service Type/ESBContainer classpath (I notice you have another question on the forum around this - it's gone midnight here in the UK so I'll defer that until tomorrow).

One consideration to note is that assuming you are using the Sonic JNDI then any JNDI lookup will be resolved against the managment brokers (and Directory Service).  Typically within the Sonic deployment architecture the availability of the managment broker(s) is not required to be as high as the ESB service/mesaging brokers.  Therefore it should be forseen that the management broker(s) may not available and code your service appropriately.

In a similar vein you may also wish to consider how any change in the JNDI store is populated to you service i.e. should the service need to be shutdown (not stopped) and then started to pick up a change?  A services init method is only executed once, i.e. an ESBContainer stop/start would not be sufficient.  For more information be sure to read the product documentation on the ESB service lifecycle.

I've made a few assumptions above in order to provide some additional information based on my experiences.  Hopefully they prove useful.

Kind regards

Kevin

Posted by teeljb on 01-Feb-2012 14:49

Thanks very much for the response, Kevin. I wasn't aware of the start/stop vs. shutdown distinction; that's definitely good to know ahead of time! I'll read up on the services lifecycle.

Regards,

Jim

This thread is closed