0

I am new to service integration bus. I have configured a bus, and added my websphere portal server as bus member. Next have created a topic connection factory, and have selected the created bus here, I want to send a message to service integration bus default topic space. I am not sure on how to send a message to the default topic space using JMS

aryanRaj_kary
  • 503
  • 2
  • 7
  • 28

1 Answers1

0

The only thing that remains is to create a new Topic (Resources > JMS > Topics > New) ,in which to choose the topic space you want to use, which in your case is Default.Topic.Space. After that you can send a message to your topic using code like this:

// Get the connection factory
connFactory=(ConnectionFactory)initCtx.lookup("jms/mycf");
// Get the destination used to send a message
destination = (Destination)initCtx.lookup("jms/mytopic");

Connection conn = connFactory.createConnection();
// Create a non-transacted session
Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
// Create the message producer
MessageProducer msgProducer = session.createProducer(destination);
// Create the message
TextMessage txtMsg = session.createTextMessage("Hello There!!!");

 // Send the message
 msgProducer.send(txtMsg);
 session.close();
 conn.close();
trikelef
  • 2,192
  • 1
  • 22
  • 39
  • thank you, got it, was reading the documentation also, know I understand that topic spaces can have destination of type Queue or topic. – aryanRaj_kary Apr 06 '13 at 01:47