KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > javax > jms > TemporaryQueue

javax.jms
Interface TemporaryQueue

All Superinterfaces:
Destination, Queue
See Also:
Top Examples, Source Code, Session.createTemporaryQueue(), QueueSession.createTemporaryQueue()

public void delete()
            throws JMSException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[938]Using TemporaryQueue
By Anonymous on 2004/09/27 13:50:39  Rate
//session is an instance of QueueSession 
 TemporaryQueue tmpQueue = session.createTemporaryQueue (  ) ; 
  
  
 .. sending msg to the TemporaryQueue 
  
  
 // waiting reply  
 MessageConsumer consumer = session.createReceiver ( tmpQueue ) ; 
  
  
 //queueConnection is instance of QueueConnection 
 queueConnection.start (  ) ; 
  
  
 Message message = consumer.receive (  ) ; 
 queueConnection.stop (  ) ; 
  
  
 ... do something with the message 
  
  
 TemporaryQueue tmpReplyQueue =  ( TemporaryQueue )  msg.getJMSReplyTo (  ) ; 
 QueueSender sender = session.createSender ( tmpReplyQueue ) ; 
  
  
 ... send the reply msg to the tmpReplyQueue ... 
 

Popular Tags