3

I’m working on spring boot with tibco ems project.

Required to create producer nd consumer configurations. Could any one guide with configurations

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
srinivasV
  • 31
  • 1
  • 2

1 Answers1

4

Import tibjms.jar library, then:

import com.tibco.tibjms.TibjmsConnectionFactory;

and create the following beans:

  @Bean
  public TibjmsConnectionFactory connectionFactory() {
      TibjmsConnectionFactory connectionFactory = new TibjmsConnectionFactory("tcp://localhost:7222");
    return connectionFactory;
  }

  @Bean
  public JmsTemplate JmsTemplate() {
    JmsTemplate jmsTemplate =
        new JmsTemplate(connectionFactory());
    return jmsTemplate;
  }

The receiver will be:

@Component
public class Receiver {

    @JmsListener(destination = "test_queue")
    public void receiveMessage(String message) {
        System.out.println("Received <" + message + ">");
    }
}

and the sender will be:

JmsTemplate jmsTemplate = context.getBean(JmsTemplate.class);
jmsTemplate.convertAndSend("test_queue", "Hello");
Daniele Chirivì
  • 466
  • 4
  • 11