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
Fields Modifier and Type Field Description protected AmqpConnectionconnectionprotected booleandelayedDeliverySupportedprotected booleanpresettleprotected AmqpSessionsession-
Fields inherited from class org.apache.qpid.jms.provider.amqp.AmqpAbstractResource
closeRequest, closeTimeoutTask
-
-
Constructor Summary
Constructors Constructor Description AmqpProducer(AmqpSession session, JmsProducerInfo info)AmqpProducer(AmqpSession session, JmsProducerInfo info, org.apache.qpid.proton.engine.Sender endpoint)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description JmsProducerIdgetProducerId()abstract booleanisAnonymous()booleanisPresettle()abstract 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 Detail
-
session
protected final AmqpSession session
-
connection
protected final AmqpConnection connection
-
presettle
protected boolean presettle
-
delayedDeliverySupported
protected boolean delayedDeliverySupported
-
-
Constructor Detail
-
AmqpProducer
public AmqpProducer(AmqpSession session, JmsProducerInfo info)
-
AmqpProducer
public AmqpProducer(AmqpSession session, JmsProducerInfo info, org.apache.qpid.proton.engine.Sender endpoint)
-
-
Method Detail
-
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
public JmsProducerId 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)
-
-