Class AmqpProducer
java.lang.Object
org.apache.qpid.jms.provider.amqp.AmqpAbstractResource<JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
org.apache.qpid.jms.provider.amqp.AmqpProducer
- All Implemented Interfaces:
AmqpEventSink,AmqpResource
- Direct Known Subclasses:
AmqpAnonymousFallbackProducer,AmqpFixedProducer
public abstract class AmqpProducer
extends AmqpAbstractResource<JmsProducerInfo,org.apache.qpid.proton.engine.Sender>
Base class for Producer instances.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AmqpConnectionprotected booleanprotected booleanprotected final AmqpSessionFields inherited from class org.apache.qpid.jms.provider.amqp.AmqpAbstractResource
closeRequest, closeTimeoutTask -
Constructor Summary
ConstructorsConstructorDescriptionAmqpProducer(AmqpSession session, JmsProducerInfo info) AmqpProducer(AmqpSession session, JmsProducerInfo info, org.apache.qpid.proton.engine.Sender endpoint) -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanbooleanabstract voidsend(JmsOutboundMessageDispatch envelope, AsyncResult request) Sends the given messagevoidsetDelayedDeliverySupported(boolean delayedDeliverySupported) voidsetPresettle(boolean presettle) Sets whether the producer will presettle all messages that it sends.Methods inherited from class org.apache.qpid.jms.provider.amqp.AmqpAbstractResource
close, closeOrDetachEndpoint, closeResource, getEndpoint, getLocalState, getParent, getRemoteState, getResourceInfo, handleResourceClosure, isAwaitingClose, isClosed, isOpen, processDeliveryUpdates, processFlowUpdates, processRemoteClose, processRemoteDetach, processRemoteOpen
-
Field Details
-
session
-
connection
-
presettle
protected boolean presettle -
delayedDeliverySupported
protected boolean delayedDeliverySupported
-
-
Constructor Details
-
AmqpProducer
-
AmqpProducer
public AmqpProducer(AmqpSession session, JmsProducerInfo info, org.apache.qpid.proton.engine.Sender endpoint)
-
-
Method Details
-
send
public abstract void send(JmsOutboundMessageDispatch envelope, AsyncResult request) throws ProviderException Sends the given message- Parameters:
envelope- The envelope that contains the message and it's targeted destination.request- The AsyncRequest that will be notified on send success or failure.- Throws:
ProviderException- if an error occurs sending the message
-
isAnonymous
public abstract boolean isAnonymous()- Returns:
- true if this is an anonymous producer or false if fixed to a given destination.
-
getProducerId
- Returns:
- the JmsProducerId that was assigned to this AmqpProducer.
-
isPresettle
public boolean isPresettle()- Returns:
- true if the producer should presettle all sent messages.
-
setPresettle
public void setPresettle(boolean presettle) Sets whether the producer will presettle all messages that it sends. Sending presettled reduces the time it takes to send a message but increases the change of message loss should the connection drop during send.- Parameters:
presettle- true if all messages are sent settled.
-
setDelayedDeliverySupported
public void setDelayedDeliverySupported(boolean delayedDeliverySupported)
-