📄 messageproducer.html
字号:
<TD><CODE><B><A HREF="../../javax/jms/MessageProducer.html#setDeliveryMode(int)">setDeliveryMode</A></B>(int deliveryMode)</CODE><BR> Sets the producer's default delivery mode. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/jms/MessageProducer.html#setDisableMessageID(boolean)">setDisableMessageID</A></B>(boolean value)</CODE><BR> Sets whether message IDs are disabled. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/jms/MessageProducer.html#setDisableMessageTimestamp(boolean)">setDisableMessageTimestamp</A></B>(boolean value)</CODE><BR> Sets whether message timestamps are disabled. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/jms/MessageProducer.html#setPriority(int)">setPriority</A></B>(int defaultPriority)</CODE><BR> Sets the producer's default priority. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/jms/MessageProducer.html#setTimeToLive(long)">setTimeToLive</A></B>(long timeToLive)</CODE><BR> Sets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system. </TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="setDisableMessageID(boolean)"><!-- --></A><H3>setDisableMessageID</H3><PRE>public void <B>setDisableMessageID</B>(boolean value) throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Sets whether message IDs are disabled. <P>Since message IDs take some effort to create and increase a message's size, some JMS providers may be able to optimize message overhead if they are given a hint that the message ID is not used by an application. By calling the <CODE>setDisableMessageID</CODE> method on this message producer, a JMS client enables this potential optimization for all messages sent by this message producer. If the JMS provider accepts this hint, these messages must have the message ID set to null; if the provider ignores the hint, the message ID must be set to its normal unique value. <P>Message IDs are enabled by default.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - indicates if message IDs are disabled<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the JMS provider fails to set message ID to disabled due to some internal error.</DL></DD></DL><HR><A NAME="getDisableMessageID()"><!-- --></A><H3>getDisableMessageID</H3><PRE>public boolean <B>getDisableMessageID</B>() throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Gets an indication of whether message IDs are disabled.<P><DD><DL><DT><B>Returns:</B><DD>an indication of whether message IDs are disabled<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the JMS provider fails to determine if message IDs are disabled due to some internal error.</DL></DD></DL><HR><A NAME="setDisableMessageTimestamp(boolean)"><!-- --></A><H3>setDisableMessageTimestamp</H3><PRE>public void <B>setDisableMessageTimestamp</B>(boolean value) throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Sets whether message timestamps are disabled. <P>Since timestamps take some effort to create and increase a message's size, some JMS providers may be able to optimize message overhead if they are given a hint that the timestamp is not used by an application. By calling the <CODE>setDisableMessageTimestamp</CODE> method on this message producer, a JMS client enables this potential optimization for all messages sent by this message producer. If the JMS provider accepts this hint, these messages must have the timestamp set to zero; if the provider ignores the hint, the timestamp must be set to its normal value. <P>Message timestamps are enabled by default.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - indicates if message timestamps are disabled<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the JMS provider fails to set timestamps to disabled due to some internal error.</DL></DD></DL><HR><A NAME="getDisableMessageTimestamp()"><!-- --></A><H3>getDisableMessageTimestamp</H3><PRE>public boolean <B>getDisableMessageTimestamp</B>() throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Gets an indication of whether message timestamps are disabled.<P><DD><DL><DT><B>Returns:</B><DD>an indication of whether message timestamps are disabled<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the JMS provider fails to determine if timestamps are disabled due to some internal error.</DL></DD></DL><HR><A NAME="setDeliveryMode(int)"><!-- --></A><H3>setDeliveryMode</H3><PRE>public void <B>setDeliveryMode</B>(int deliveryMode) throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Sets the producer's default delivery mode. <P>Delivery mode is set to <CODE>PERSISTENT</CODE> by default.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>deliveryMode</CODE> - the message delivery mode for this message producer; legal values are <code>DeliveryMode.NON_PERSISTENT</code> and <code>DeliveryMode.PERSISTENT</code><DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the JMS provider fails to set the delivery mode due to some internal error.<DT><B>See Also:</B><DD><A HREF="../../javax/jms/MessageProducer.html#getDeliveryMode()"><CODE>getDeliveryMode()</CODE></A>, <A HREF="../../javax/jms/DeliveryMode.html#NON_PERSISTENT"><CODE>DeliveryMode.NON_PERSISTENT</CODE></A>, <A HREF="../../javax/jms/DeliveryMode.html#PERSISTENT"><CODE>DeliveryMode.PERSISTENT</CODE></A>, <A HREF="../../javax/jms/Message.html#DEFAULT_DELIVERY_MODE"><CODE>Message.DEFAULT_DELIVERY_MODE</CODE></A></DL></DD></DL><HR><A NAME="getDeliveryMode()"><!-- --></A><H3>getDeliveryMode</H3><PRE>public int <B>getDeliveryMode</B>() throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Gets the producer's default delivery mode.<P><DD><DL><DT><B>Returns:</B><DD>the message delivery mode for this message producer<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the JMS provider fails to get the delivery mode due to some internal error.<DT><B>See Also:</B><DD><A HREF="../../javax/jms/MessageProducer.html#setDeliveryMode(int)"><CODE>setDeliveryMode(int)</CODE></A></DL></DD></DL><HR><A NAME="setPriority(int)"><!-- --></A><H3>setPriority</H3><PRE>public void <B>setPriority</B>(int defaultPriority) throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Sets the producer's default priority. <P>The JMS API defines ten levels of priority value, with 0 as the lowest priority and 9 as the highest. Clients should consider priorities 0-4 as gradations of normal priority and priorities 5-9 as gradations of expedited priority. Priority is set to 4 by default.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>defaultPriority</CODE> - the message priority for this message producer; must be a value between 0 and 9<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the JMS provider fails to set the priority due to some internal error.<DT><B>See Also:</B><DD><A HREF="../../javax/jms/MessageProducer.html#getPriority()"><CODE>getPriority()</CODE></A>, <A HREF="../../javax/jms/Message.html#DEFAULT_PRIORITY"><CODE>Message.DEFAULT_PRIORITY</CODE></A></DL></DD></DL><HR><A NAME="getPriority()"><!-- --></A><H3>getPriority</H3><PRE>public int <B>getPriority</B>() throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Gets the producer's default priority.<P><DD><DL><DT><B>Returns:</B><DD>the message priority for this message producer<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></CODE> - if the JMS provider fails to get the priority due to some internal error.<DT><B>See Also:</B><DD><A HREF="../../javax/jms/MessageProducer.html#setPriority(int)"><CODE>setPriority(int)</CODE></A></DL></DD></DL><HR><A NAME="setTimeToLive(long)"><!-- --></A><H3>setTimeToLive</H3><PRE>public void <B>setTimeToLive</B>(long timeToLive) throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Sets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system. <P>Time to live is set to zero by default.<P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -