public class AMQSession_0_10 extends AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10> implements SessionListener
AMQSession.Dispatchable
DAEMON_DISPATCHER_THREAD, DISPATCHER_SHUTDOWN_TIMEOUT_MS, DISPATCHER_SHUTDOWN_TIMEOUT_MS_DEFAULT, IMMEDIATE_PREFETCH, IMMEDIATE_PREFETCH_DEFAULT, STRICT_AMQP, STRICT_AMQP_DEFAULT, STRICT_AMQP_FATAL, STRICT_AMQP_FATAL_DEFAULT
NO_ACKNOWLEDGE, PRE_ACKNOWLEDGE
Modifier and Type | Method and Description |
---|---|
protected void |
acknowledgeImpl() |
void |
acknowledgeMessage(long deliveryTag,
boolean multiple)
Acknowledge one or many messages.
|
protected void |
addDeliveredMessage(long id)
Store non committed messages for this session
|
void |
closed(Session ssn) |
void |
commitImpl() |
BasicMessageConsumer_0_10 |
createMessageConsumer(AMQDestination destination,
int prefetchHigh,
int prefetchLow,
boolean noLocal,
boolean exclusive,
String messageSelector,
Map<String,Object> rawSelector,
boolean noConsume,
boolean autoClose)
Create an 0_10 message consumer
|
BasicMessageProducer_0_10 |
createMessageProducer(javax.jms.Destination destination,
Boolean mandatory,
Boolean immediate,
long producerId)
Create an 0_10 message producer
|
protected Session |
createSession() |
protected String |
declareQueue(AMQDestination amqd,
boolean noLocal,
boolean nowait,
boolean passive) |
protected void |
doBind(AMQDestination dest,
AMQDestination.Binding binding,
String queue,
String exchange) |
void |
exception(Session ssn,
SessionException exc) |
protected void |
flushAcknowledgments() |
QpidException |
getCurrentException()
Get the latest thrown exception.
|
QpidException |
getLastException() |
AMQMessageDelegateFactory |
getMessageDelegateFactory() |
protected Connection |
getQpidConnection() |
protected Session |
getQpidSession()
Access to the underlying Qpid Session
|
protected void |
handleQueueNodeCreation(AMQDestination dest,
boolean noLocal) |
protected boolean |
isBound(String exchangeName,
String amqQueueName,
String routingKey) |
boolean |
isExchangeExist(AMQDestination dest,
boolean assertNode) |
boolean |
isFlowBlocked()
Tests whether flow to this session is blocked.
|
boolean |
isQueueBound(AMQDestination destination) |
boolean |
isQueueBound(String exchangeName,
String queueName,
String routingKey)
Bind a queue with an exchange.
|
boolean |
isQueueBound(String exchangeName,
String queueName,
String bindingKey,
Map<String,Object> args) |
boolean |
isQueueBound(String exchangeName,
String queueName,
String routingKey,
String[] bindingKeys) |
boolean |
isQueueExist(AMQDestination dest,
boolean assertNode) |
boolean |
isQueueExist(String queueName,
boolean assertNode,
boolean durable,
boolean autoDelete,
boolean exclusive,
Map<String,Object> args) |
void |
message(Session ssn,
MessageTransfer xfr) |
void |
opened(Session ssn) |
void |
rejectMessage(long deliveryTag,
boolean requeue)
Release (0_8 notion of Reject) an acquired message
|
void |
releaseForRollback() |
protected Long |
requestQueueDepth(AMQDestination amqd,
boolean sync) |
int |
resolveAddressType(AMQDestination dest) |
void |
resumed(Session ssn) |
String |
send0_10QueueDeclare(AMQDestination amqd,
boolean noLocal,
boolean nowait,
boolean passive)
Declare a queue with the given queueName
|
void |
sendClose(long timeout)
Close this session.
|
void |
sendConsume(BasicMessageConsumer_0_10 consumer,
String queueName,
boolean nowait,
int tag)
This method is invoked when a consumer is created
Registers the consumer with the broker
|
void |
sendCreateQueue(String name,
boolean autoDelete,
boolean durable,
boolean exclusive,
Map<String,Object> arguments)
Create a queue with a given name.
|
void |
sendExchangeDeclare(String name,
String type,
boolean nowait,
boolean durable,
boolean autoDelete,
boolean internal)
creates an exchange if it does not already exist
|
void |
sendExchangeDeclare(String name,
String type,
boolean nowait,
boolean durable,
boolean autoDelete,
Map<String,Object> arguments,
boolean passive) |
void |
sendExchangeDeclare(String name,
String type,
String alternateExchange,
Map<String,Object> args,
boolean nowait,
boolean durable,
boolean autoDelete) |
void |
sendExchangeDelete(String name,
boolean nowait)
deletes an exchange
|
void |
sendQueueBind(String queueName,
String routingKey,
Map<String,Object> arguments,
String exchangeName,
AMQDestination destination,
boolean nowait)
Bind a queue with an exchange.
|
void |
sendQueueDelete(String queueName)
deletes a queue
|
void |
sendRecover()
This method asks the broker to redeliver all unacknowledged messages
|
void |
sendRollback() |
void |
sendSuspendChannel(boolean suspend)
Activate/deactivate the message flow for all the consumers of this session.
|
protected void |
sendTxCompletionsIfNecessary()
With 0.10 messages are consumed with window mode, we must send a completion
before the window size is reached so credits don't dry up.
|
void |
setCurrentException(SessionException se) |
void |
setFlowControl(boolean active) |
void |
sync() |
protected boolean |
tagLE(long tag1,
long tag2) |
protected boolean |
updateRollbackMark(long currentMark,
long deliveryTag) |
acknowledge, addBindingKey, addUnacknowledgedMessage, bindQueue, bindQueue, checkNotClosed, checkTransacted, checkValidTopic, checkValidTopic, clearDispatchQueue, close, close, closed, commit, confirmConsumerCancelled, createBrowser, createBrowser, createBrowserConsumer, createBytesMessage, createConsumer, createConsumer, createConsumer, createConsumer, createConsumer, createConsumer, createConsumerImpl, createDurableSubscriber, createDurableSubscriber, createListMessage, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createProducer, createProducer, createPublisher, createQueue, createQueue, createQueue, createQueueReceiver, createQueueReceiver, createReceiver, createReceiver, createSender, createStreamMessage, createSubscriber, createSubscriber, createTemporaryQueue, createTemporaryQueueName, createTemporaryTopic, createTextMessage, createTextMessage, createTopic, declareAndBind, declareAndBind, declareExchange, declareQueue, declareQueue, deleteExchange, deleteQueue, deleteTemporaryDestination, dispatch, drainDispatchQueueWithDispatcher, getAcknowledgeMode, getAMQConnection, getChannelId, getConsumers, getDefaultPrefetch, getDefaultPrefetchHigh, getDefaultPrefetchLow, getDefaultQueueExchangeName, getDefaultTopicExchangeName, getDeliveredMessageTags, getDispatcher, getDispatcherThread, getFailoverMutex, getHighestDeliveryTag, getMessageEncryptionHelper, getMessageFactoryRegistry, getMessageListener, getPrefetch, getPrefetchedMessageTags, getQueueDepth, getQueueDepth, getTemporaryQueueExchangeName, getTemporaryTopicExchangeName, getTicket, getTransacted, getUnacknowledgedMessageTags, hasConsumer, hasFailedOverDirty, hasMessageListeners, isClosed, isClosing, isDeclareExchanges, isImmediatePrefetch, isStrictAMQP, isSuspended, isTransacted, markClean, markDirty, messageReceived, prefetch, preprocessAddressTopic, recover, rejectMessage, rejectMessage, resolveAddress, rollback, run, setLegacyFieldsForQueueType, setLegacyFieldsForTopicType, setMessageListener, setTicket, setUsingDispatcherForCleanup, stopDispatcherThread, stopExistingDispatcher, suspendChannel, suspendChannelIfNotClosing, unsubscribe, verifySubject
setClosed, setClosing
protected Session createSession()
protected Connection getQpidConnection()
public void acknowledgeMessage(long deliveryTag, boolean multiple)
acknowledgeMessage
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
deliveryTag
- The tag of the last message to be acknowledged.multiple
- true to acknowledge all messages up to and including the one specified by the
delivery tag, false to just acknowledge that message.protected void flushAcknowledgments()
flushAcknowledgments
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
public void sendQueueBind(String queueName, String routingKey, Map<String,Object> arguments, String exchangeName, AMQDestination destination, boolean nowait) throws QpidException
sendQueueBind
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
queueName
- Specifies the name of the queue to bind. If the queue name is empty,
refers to the current
queue for the session, which is the last declared queue.exchangeName
- The exchange name.routingKey
- Specifies the routing key for the binding.arguments
- 0_8 specificQpidException
public void sendClose(long timeout) throws QpidException, FailoverException
sendClose
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
timeout
- no used / 0_8 specificQpidException
FailoverException
public void sendCreateQueue(String name, boolean autoDelete, boolean durable, boolean exclusive, Map<String,Object> arguments) throws QpidException, FailoverException
sendCreateQueue
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
name
- The queue nameautoDelete
- If this field is set and the exclusive field is also set,
then the queue is deleted when the connection closes.durable
- If set when creating a new queue,
the queue will be marked as durable.exclusive
- Exclusive queues can only be used from one connection at a time.arguments
- Exclusive queues can only be used from one connection at a time.QpidException
FailoverException
public void sendRecover() throws QpidException, FailoverException
sendRecover
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
QpidException
FailoverException
public void releaseForRollback()
releaseForRollback
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
public void rejectMessage(long deliveryTag, boolean requeue)
rejectMessage
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
deliveryTag
- the message IDrequeue
- always truepublic BasicMessageConsumer_0_10 createMessageConsumer(AMQDestination destination, int prefetchHigh, int prefetchLow, boolean noLocal, boolean exclusive, String messageSelector, Map<String,Object> rawSelector, boolean noConsume, boolean autoClose) throws javax.jms.JMSException
createMessageConsumer
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
javax.jms.JMSException
public boolean isQueueBound(String exchangeName, String queueName, String routingKey)
isQueueBound
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
exchangeName
- The exchange name to test for binding against.queueName
- The queue name to check if bound.routingKey
- The routing key to check if the queue is bound under.public boolean isQueueBound(AMQDestination destination)
isQueueBound
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
public boolean isQueueBound(String exchangeName, String queueName, String routingKey, String[] bindingKeys)
public boolean isQueueBound(String exchangeName, String queueName, String bindingKey, Map<String,Object> args)
isQueueBound
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
protected boolean isBound(String exchangeName, String amqQueueName, String routingKey)
isBound
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
public void sendConsume(BasicMessageConsumer_0_10 consumer, String queueName, boolean nowait, int tag) throws QpidException, FailoverException
sendConsume
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
QpidException
FailoverException
public BasicMessageProducer_0_10 createMessageProducer(javax.jms.Destination destination, Boolean mandatory, Boolean immediate, long producerId) throws javax.jms.JMSException
createMessageProducer
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
javax.jms.JMSException
public void sendExchangeDeclare(String name, String type, boolean nowait, boolean durable, boolean autoDelete, boolean internal) throws QpidException, FailoverException
sendExchangeDeclare
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
QpidException
FailoverException
public void sendExchangeDeclare(String name, String type, boolean nowait, boolean durable, boolean autoDelete, Map<String,Object> arguments, boolean passive) throws QpidException, FailoverException
sendExchangeDeclare
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
QpidException
FailoverException
public void sendExchangeDeclare(String name, String type, String alternateExchange, Map<String,Object> args, boolean nowait, boolean durable, boolean autoDelete) throws QpidException
QpidException
public void sendExchangeDelete(String name, boolean nowait) throws QpidException, FailoverException
QpidException
FailoverException
public String send0_10QueueDeclare(AMQDestination amqd, boolean noLocal, boolean nowait, boolean passive) throws QpidException
QpidException
public void sendQueueDelete(String queueName) throws QpidException, FailoverException
sendQueueDelete
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
QpidException
FailoverException
public void sendSuspendChannel(boolean suspend) throws QpidException, FailoverException
sendSuspendChannel
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
QpidException
FailoverException
public void sendRollback() throws QpidException, FailoverException
sendRollback
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
QpidException
FailoverException
protected Session getQpidSession()
public QpidException getCurrentException()
SessionException
- get the latest thrown error.public void opened(Session ssn)
opened
in interface SessionListener
public void resumed(Session ssn)
resumed
in interface SessionListener
public void message(Session ssn, MessageTransfer xfr)
message
in interface SessionListener
public void exception(Session ssn, SessionException exc)
exception
in interface SessionListener
public void closed(Session ssn)
closed
in interface SessionListener
public QpidException getLastException()
getLastException
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
protected String declareQueue(AMQDestination amqd, boolean noLocal, boolean nowait, boolean passive) throws QpidException
declareQueue
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
QpidException
protected Long requestQueueDepth(AMQDestination amqd, boolean sync)
requestQueueDepth
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
protected void addDeliveredMessage(long id)
addDeliveredMessage
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
id
- protected void sendTxCompletionsIfNecessary()
public void commitImpl() throws QpidException, FailoverException, TransportException
commitImpl
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
QpidException
FailoverException
TransportException
protected final boolean tagLE(long tag1, long tag2)
tagLE
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
protected final boolean updateRollbackMark(long currentMark, long deliveryTag)
updateRollbackMark
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
public void sync() throws QpidException
sync
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
QpidException
public void setCurrentException(SessionException se)
public AMQMessageDelegateFactory getMessageDelegateFactory()
getMessageDelegateFactory
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
public boolean isExchangeExist(AMQDestination dest, boolean assertNode) throws QpidException
isExchangeExist
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
QpidException
public boolean isQueueExist(AMQDestination dest, boolean assertNode) throws QpidException
isQueueExist
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
QpidException
public boolean isQueueExist(String queueName, boolean assertNode, boolean durable, boolean autoDelete, boolean exclusive, Map<String,Object> args) throws QpidException
QpidException
public int resolveAddressType(AMQDestination dest) throws QpidException
resolveAddressType
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
QpidException
protected void acknowledgeImpl()
acknowledgeImpl
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
public boolean isFlowBlocked()
AMQSession
isFlowBlocked
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
public void setFlowControl(boolean active)
setFlowControl
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
protected void handleQueueNodeCreation(AMQDestination dest, boolean noLocal) throws QpidException
handleQueueNodeCreation
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
QpidException
protected void doBind(AMQDestination dest, AMQDestination.Binding binding, String queue, String exchange)
doBind
in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.