Does solace spring boot JMS api automatically help to configuration the JNDI object in the backend?

rayleeustc_ll
rayleeustc_ll Member Posts: 7 ✭✭

when I test solace samples https://github.com/SolaceSamples/solace-samples-spring.git found that. Seem we do not need the JNDI object configuration when used JMS API depended from solace-jms-spring-boot-starter.

Does solace spring boot JMS api automatically help to configuration the JNDI object in the backend?

Answers

  • amackenzie
    amackenzie Member, Employee Posts: 268 Solace Employee

    Hello.

    The Spring Cloud Stream samples you are referring to do not use JMS, they use JCSMP (a Solace Java API), as the API underneath the Spring Cloud Stream binder APIs to access PubSub+.

    There is no JNDI in this case.

  • amackenzie
    amackenzie Member, Employee Posts: 268 Solace Employee

    Sorry, my answer was not complete... There are 2 samples that use JMS.

    In both cases, the `DestinationResolver` interface is used to resolve if it's a queue or topic being used to send or receive. The default in this interface is queue.

    The send sample references a property called `setPubSubDomain` which defaults to false, thereby indicating a queue.

    Since the destination is resolved to a queue in both cases, a JNDI lookup for destination is not needed and no object is created in JNDI.

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 959 admin
    edited March 2022 #4

    thanks @amackenzie.

    @rayleeustc_ll, To add a little more information here, the Spring Boot JMS Starter does NOT automatically configure JNDI. There is actually an example of how to do that included int he solace-spring-boot repo [here](https://github.com/SolaceProducts/solace-spring-boot/tree/master/solace-spring-boot-samples/solace-jms-sample-app-jndi) which might help.