Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

TibcojmsConnectionFactory configuration issues

I am trying to work on a tibco JMS CDC product. I have issues setting up the configuration and could not find a solution to my problem.

import com.tibco.tibjms.TibjmsConnectionFactory;

import javax.jms.JMSException;
@Configuration
@EnableJms
public class TibcoBusConfiguration {
    @Value("${ems.password}")
    private String password;

    @Value("${ems.port}")
    private String port;

    @Value("${ems.topic}")
    private String queue;

    @Value("${ems.server}")
    private String server;

    @Value("${ems.user}")
    private String user;

    @Bean(name = "tibjmsConnectionFactory")
    public TibjmsConnectionFactory jmsConnectionFactory() throws javax.jms.JMSException {
        final TibjmsConnectionFactory factory = new TibjmsConnectionFactory();

        factory.setServerUrl(serverURL());
        factory.setUserName(user);
        factory.setUserPassword(password);

        return factory;
    }

    @Bean
    public JmsTemplate jmsTemplate(
        @Autowired TibjmsConnectionFactory tibjmsConnectionFactory) throws JMSException {
        final JmsTemplate jmsTemplate = new JmsTemplate();

        jmsTemplate.setConnectionFactory(jmsConnectionFactory());
        jmsTemplate.setDefaultDestinationName(queue);
        jmsTemplate.setExplicitQosEnabled(true);
        jmsTemplate.setDeliveryMode(DeliveryMode.PERSISTENT);
        jmsTemplate.setSessionAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE);
        jmsTemplate.setSessionTransacted(false);

        return jmsTemplate;
    }

    private String serverURL() {
        return "tcp://" + server + ":" + port;
    }



}

Unfortunately JmsTemplate only allows jakarta.jms.ConnectionFactory, how do I pass in the TibcoConnectionFactory, because casting is not allowed since the classes do not match. Is my understanding of this incorrect?

I have the following JAR’s in my maven setup: tibjms.jar jakarta.jms-api-3.0 javax.jms-api-2.0

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Thanks in Advance

>Solution :

Boot 3/Spring 6 moved from the javax to the jakarta namespace for JEE support – you either need to find a Tibco jar for JEE 9 or drop back to Boot 2.7/Spring 5.3.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading