Websphere MQ Everyplace

com.ibm.mqe.jms
Class MQeMessageProducer

java.lang.Object
  |
  +--com.ibm.mqe.jms.MQeMessageProducer
All Implemented Interfaces:
javax.jms.MessageProducer
Direct Known Subclasses:
MQeQueueSender

public class MQeMessageProducer
extends java.lang.Object
implements javax.jms.MessageProducer

A client uses a message producer to send messages to a Destination.

A client can specify a default delivery mode, priority and time-to-live for messages sent by a message producer. It can also specify delivery mode, priority and time-to-live per message.

See Also:
MQeQueueSender, MQeSession

Constructor Summary
MQeMessageProducer()
           
 
Method Summary
 int getDeliveryMode()
          Get the producer's default delivery mode.
 boolean getDisableMessageID()
          Get an indication of whether message IDs are disabled.
 boolean getDisableMessageTimestamp()
          Get an indication of whether message timestamps are disabled.
 int getPriority()
          Get the producer's default priority.
 long getTimeToLive()
          Get the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
 void setDeliveryMode(int deliveryMode)
          Set the producer's default delivery mode.
 void setDisableMessageID(boolean value)
          Set whether message IDs are disabled.
 void setDisableMessageTimestamp(boolean value)
          Set whether message timestamps are disabled.
 void setPriority(int priority)
          Set the producer's default priority.
 void setTimeToLive(long timeToLive)
          Set the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jms.MessageProducer
close
 

Constructor Detail

MQeMessageProducer

public MQeMessageProducer()
Method Detail

setDisableMessageID

public void setDisableMessageID(boolean value)
                         throws javax.jms.JMSException
Set whether message IDs are disabled. Message IDs are enabled by default.

Specified by:
setDisableMessageID in interface javax.jms.MessageProducer
Parameters:
value - indicates if message IDs are disabled.
Throws:
javax.jms.JMSException - if JMS fails to set disabled message Id due to some internal error.

getDisableMessageID

public boolean getDisableMessageID()
                            throws javax.jms.JMSException
Get an indication of whether message IDs are disabled.

Specified by:
getDisableMessageID in interface javax.jms.MessageProducer
Returns:
an indication of whether message IDs are disabled.
Throws:
javax.jms.JMSException - if JMS fails to get disabled message Id due to some internal error.

setDisableMessageTimestamp

public void setDisableMessageTimestamp(boolean value)
                                throws javax.jms.JMSException
Set whether message timestamps are disabled. WebSphere MQ Everyplace JMS messages always contain a timestamp, regardless of the value set here.

Specified by:
setDisableMessageTimestamp in interface javax.jms.MessageProducer
Parameters:
value - indicates if message timestamps are disabled.
Throws:
javax.jms.JMSException - if JMS fails to set disabled message timestamp due to some internal error.

getDisableMessageTimestamp

public boolean getDisableMessageTimestamp()
                                   throws javax.jms.JMSException
Get an indication of whether message timestamps are disabled.

Specified by:
getDisableMessageTimestamp in interface javax.jms.MessageProducer
Returns:
an indication of whether message IDs are disabled.
Throws:
javax.jms.JMSException - if JMS fails to get disabled message timestamp due to some internal error.

setDeliveryMode

public void setDeliveryMode(int deliveryMode)
                     throws javax.jms.JMSException
Set the producer's default delivery mode. Delivery mode is set to PERSISTENT by default.

Specified by:
setDeliveryMode in interface javax.jms.MessageProducer
Parameters:
deliveryMode - the message delivery mode for this message producer.
Throws:
javax.jms.JMSException - if JMS fails to set delivery mode due to some internal error.
See Also:
MessageProducer.getDeliveryMode()

getDeliveryMode

public int getDeliveryMode()
                    throws javax.jms.JMSException
Get the producer's default delivery mode.

Specified by:
getDeliveryMode in interface javax.jms.MessageProducer
Returns:
the message delivery mode for this message producer.
Throws:
javax.jms.JMSException - if JMS fails to get delivery mode due to some internal error.
See Also:
MessageProducer.setDeliveryMode(int)

setPriority

public void setPriority(int priority)
                 throws javax.jms.JMSException
Set the producer's default priority. Priority is set to 4, by default.

Specified by:
setPriority in interface javax.jms.MessageProducer
Parameters:
priority - the message priority for this message producer.
Throws:
javax.jms.JMSException - if JMS fails to set priority due to some internal error.
See Also:
MessageProducer.getPriority()

getPriority

public int getPriority()
                throws javax.jms.JMSException
Get the producer's default priority.

Specified by:
getPriority in interface javax.jms.MessageProducer
Returns:
the message priority for this message producer.
Throws:
javax.jms.JMSException - if JMS fails to get priority due to some internal error.
See Also:
MessageProducer.setPriority(int)

setTimeToLive

public void setTimeToLive(long timeToLive)
                   throws javax.jms.JMSException
Set the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system. Time to live is set to zero (i.e. messages do not expire) by default.

Specified by:
setTimeToLive in interface javax.jms.MessageProducer
Parameters:
timeToLive - the message time to live in milliseconds; zero is unlimited
Throws:
javax.jms.JMSException - if JMS fails to set Time to Live due to some internal error.
See Also:
MessageProducer.getTimeToLive()

getTimeToLive

public long getTimeToLive()
                   throws javax.jms.JMSException
Get the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.

Specified by:
getTimeToLive in interface javax.jms.MessageProducer
Returns:
the message time to live in milliseconds; zero is unlimited
Throws:
javax.jms.JMSException - if JMS fails to get Time to Live due to some internal error.
See Also:
MessageProducer.setTimeToLive(long)

Websphere MQ Everyplace