'SolaceMessageProducer not blocking send call while producing message on the incorrect queue

I am using solace-jms-spring-boot-starter (4.1.0) with all default properties

solace:
  jms:
    msgVpn: default
    host: smf://default:55555}
    clientName: default
    clientPassword: 
    directTransport: false

I am autowiring @ConnectionFactory and @JmsTemplate and using it directly to consumer and publish messages on Solace. I was able to consume messages correctly

but while publishing message on solace if I configure queue name incorrectly on purpose publisher is not throwing exception right away, it executes the next line as well

try{
   publisher.send(message, queueNotAvailable); <----- if wrong queue name mentioned 
   log.info("message sent"); <--- it still prints this
}catch(Exception e){
   log.error("exception caught"); <--- control flow not coming here
}

just after printing "message sent"

I get below exception but not in catch block

com.solacesystems.jcsmp.JCSMPErrorResponseException: 400: Queue Not Found

and then transaction gets rolled back and message gets redelivered again.

note : When I use MQ approach mq-jms-spring-boot-starter This works as expected.

Am I missing something here ? I want the control flow to go in the exception block instead of going to next line and then print exception

Any help is much appreciated



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source