public class SQSMessageProducer extends Object implements javax.jms.MessageProducer, javax.jms.QueueSender
A client also has the option of creating a message producer without supplying a queue destination. In this case, a destination must be provided with every send operation.
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the message producer.
|
long |
getDeliveryDelay()
Gets the minimum length of time in milliseconds that must elapse after a
message is sent before the JMS provider may deliver the message to a consumer.
|
int |
getDeliveryMode()
This method is not supported.
|
javax.jms.Destination |
getDestination()
Gets the destination associated with this MessageProducer.
|
boolean |
getDisableMessageID()
This method is not supported.
|
boolean |
getDisableMessageTimestamp()
This method is not supported.
|
int |
getPriority()
This method is not supported.
|
javax.jms.Queue |
getQueue() |
long |
getTimeToLive()
This method is not supported.
|
void |
send(javax.jms.Destination destination,
javax.jms.Message message)
Sends a message to a queue destination.
|
void |
send(javax.jms.Destination destination,
javax.jms.Message message,
int deliveryMode,
int priority,
long timeToLive)
Sends a message to a queue destination.
|
void |
send(javax.jms.Message message)
Sends a message to a destination created during the creation time of this
message producer.
|
void |
send(javax.jms.Message message,
int deliveryMode,
int priority,
long timeToLive)
Sends a message to a destination created during the creation time of this
message producer.
|
void |
send(javax.jms.Queue queue,
javax.jms.Message message)
Sends a message to a queue.
|
void |
send(javax.jms.Queue queue,
javax.jms.Message message,
int deliveryMode,
int priority,
long timeToLive)
Sends a message to a queue.
|
void |
setDeliveryDelay(long deliveryDelay)
Sets the minimum length of time in milliseconds that must elapse after a
message is sent before the JMS provider may deliver the message to a consumer.
|
void |
setDeliveryMode(int deliveryMode)
This method is not supported.
|
void |
setDisableMessageID(boolean value)
This method is not supported.
|
void |
setDisableMessageTimestamp(boolean value)
This method is not supported.
|
void |
setPriority(int defaultPriority)
This method is not supported.
|
void |
setTimeToLive(long timeToLive)
This method is not supported.
|
public javax.jms.Queue getQueue()
throws javax.jms.JMSException
getQueue in interface javax.jms.QueueSenderjavax.jms.JMSExceptionpublic void send(javax.jms.Queue queue,
javax.jms.Message message)
throws javax.jms.JMSException
send in interface javax.jms.QueueSenderqueue - the queue destination to send this message tomessage - the message to sendjavax.jms.InvalidDestinationException - If a client uses this method with a destination other than
SQS queue destination.javax.jms.MessageFormatException - If an invalid message is specified.UnsupportedOperationException - If a client uses this method with a MessageProducer that
specified a destination at creation time.javax.jms.JMSException - If session is closed or internal error.public void send(javax.jms.Queue queue,
javax.jms.Message message,
int deliveryMode,
int priority,
long timeToLive)
throws javax.jms.JMSException
Send does not support deliveryMode, priority, and timeToLive. It will ignore anything in deliveryMode, priority, and timeToLive.
send in interface javax.jms.QueueSenderqueue - the queue destination to send this message tomessage - the message to senddeliveryMode - priority - timeToLive - javax.jms.InvalidDestinationException - If a client uses this method with a destination other than
SQS queue destination.javax.jms.MessageFormatException - If an invalid message is specified.UnsupportedOperationException - If a client uses this method with a MessageProducer that
specified a destination at creation time.javax.jms.JMSException - If session is closed or internal error.public javax.jms.Destination getDestination()
throws javax.jms.JMSException
getDestination in interface javax.jms.MessageProducerjavax.jms.JMSExceptionpublic void close()
throws javax.jms.JMSException
close in interface javax.jms.MessageProducerjavax.jms.JMSExceptionpublic void send(javax.jms.Message message)
throws javax.jms.JMSException
send in interface javax.jms.MessageProducersend in interface javax.jms.QueueSendermessage - the message to sendjavax.jms.MessageFormatException - If an invalid message is specified.UnsupportedOperationException - If a client uses this method with a MessageProducer that did
not specify a destination at creation time.javax.jms.JMSException - If session is closed or internal error.public void send(javax.jms.Message message,
int deliveryMode,
int priority,
long timeToLive)
throws javax.jms.JMSException
Send does not support deliveryMode, priority, and timeToLive. It will ignore anything in deliveryMode, priority, and timeToLive.
send in interface javax.jms.MessageProducersend in interface javax.jms.QueueSendermessage - the message to senddeliveryMode - priority - timeToLive - javax.jms.MessageFormatException - If an invalid message is specified.UnsupportedOperationException - If a client uses this method with a MessageProducer that did
not specify a destination at creation time.javax.jms.JMSException - If session is closed or internal error.public void send(javax.jms.Destination destination,
javax.jms.Message message)
throws javax.jms.JMSException
send in interface javax.jms.MessageProducerdestination - the queue destination to send this message tomessage - the message to sendjavax.jms.InvalidDestinationException - If a client uses this method with a destination other than
valid SQS queue destination.javax.jms.MessageFormatException - If an invalid message is specified.UnsupportedOperationException - If a client uses this method with a MessageProducer that
specified a destination at creation time.javax.jms.JMSException - If session is closed or internal error.public void send(javax.jms.Destination destination,
javax.jms.Message message,
int deliveryMode,
int priority,
long timeToLive)
throws javax.jms.JMSException
Send does not support deliveryMode, priority, and timeToLive. It will ignore anything in deliveryMode, priority, and timeToLive.
send in interface javax.jms.MessageProducerdestination - the queue destination to send this message tomessage - the message to senddeliveryMode - priority - timeToLive - javax.jms.InvalidDestinationException - If a client uses this method with a destination other than
valid SQS queue destination.javax.jms.MessageFormatException - If an invalid message is specified.UnsupportedOperationException - If a client uses this method with a MessageProducer that
specified a destination at creation time.javax.jms.JMSException - If session is closed or internal error.public void setDisableMessageID(boolean value)
throws javax.jms.JMSException
setDisableMessageID in interface javax.jms.MessageProducerjavax.jms.JMSExceptionpublic boolean getDisableMessageID()
throws javax.jms.JMSException
getDisableMessageID in interface javax.jms.MessageProducerjavax.jms.JMSExceptionpublic void setDisableMessageTimestamp(boolean value)
throws javax.jms.JMSException
setDisableMessageTimestamp in interface javax.jms.MessageProducerjavax.jms.JMSExceptionpublic boolean getDisableMessageTimestamp()
throws javax.jms.JMSException
getDisableMessageTimestamp in interface javax.jms.MessageProducerjavax.jms.JMSExceptionpublic void setDeliveryMode(int deliveryMode)
throws javax.jms.JMSException
setDeliveryMode in interface javax.jms.MessageProducerjavax.jms.JMSExceptionpublic int getDeliveryMode()
throws javax.jms.JMSException
getDeliveryMode in interface javax.jms.MessageProducerjavax.jms.JMSExceptionpublic void setPriority(int defaultPriority)
throws javax.jms.JMSException
setPriority in interface javax.jms.MessageProducerjavax.jms.JMSExceptionpublic int getPriority()
throws javax.jms.JMSException
getPriority in interface javax.jms.MessageProducerjavax.jms.JMSExceptionpublic void setTimeToLive(long timeToLive)
throws javax.jms.JMSException
setTimeToLive in interface javax.jms.MessageProducerjavax.jms.JMSExceptionpublic long getTimeToLive()
throws javax.jms.JMSException
getTimeToLive in interface javax.jms.MessageProducerjavax.jms.JMSExceptionpublic void setDeliveryDelay(long deliveryDelay)
This must be a multiple of 1000, since SQS only supports delivery delays in seconds.
public long getDeliveryDelay()
Copyright © 2022. All rights reserved.