KickJava   Java API By Example, From Geeks To Geeks.

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

javax.jms
Interface QueueSender

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

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


public void send(Message message)
          throws JMSException
See Also:
MessageProducer.getPriority(), MessageProducer.getTimeToLive(), MessageProducer.getDeliveryMode(), UnsupportedOperationException, InvalidDestinationException, MessageFormatException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[936]Reply to a JMS message
By Anonymous on 2004/09/27 13:49:23  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 ... 
 


public void send(Message message,
                 int deliveryMode,
                 int priority,
                 long timeToLive)
          throws JMSException
See Also:
Session.createProducer(javax.jms.Destination), UnsupportedOperationException, InvalidDestinationException, MessageFormatException, MessageProducer
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void send(Queue queue,
                 Message message)
          throws JMSException
See Also:
MessageProducer.getPriority(), MessageProducer.getTimeToLive(), MessageProducer.getDeliveryMode(), InvalidDestinationException, MessageFormatException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void send(Queue queue,
                 Message message,
                 int deliveryMode,
                 int priority,
                 long timeToLive)
          throws JMSException
See Also:
InvalidDestinationException, MessageFormatException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags