summaryrefslogtreecommitdiff
path: root/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
Commit message (Collapse)AuthorAgeFilesLines
...
* QPID-346,QPID-386,QPID-403, QPID-410 Rollback, Basic-Reject, QueueBrowser ↵Martin Ritchie2007-03-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NO_ACK. QPID-346 Message loss after rollback\recover QPID-386 Updated Transactional Tests to cover underlying AMQP/Qpid state. QPID-403 Implement Basic.Reject QPID-410 Queue Browsers should use not acknowledge messages. ------------------------------------- Broker TxAck - Added comment and fixed white space UnacknowledgedMessage - Added comment for messageDecrement AMQChannel - Added extra debugging. + Created a NonTransactionalContext for requeuing messages as using txContext will tie the requeue to any runing transaction. + Updated message reference counting. So it is in terms of queues don't increment when giving to client. BasicCancelMethodHandler - Added Debug log. BasicConsumeMethodHandler - Reverted to directly writes frames to the session, throwing ChannelException caused problems. Added Trace and debug logging. BasicRejectMethodHandler, ChannelCloseHandler, ConnectionCloseMethodHandler - Added Debug logging AMQPFastProtocolHandler - moved error log to before session.write AMQMessage - Added additional debug via debugIdentity() and comments AMQQueue - Decoupled reference counting from dequeue operation. ConcurrentSelectorDeliveryManager - Added comments and increased info in debug logging SubscriptionImpl - Disabled use of acks for browsers. For now put setDeliveredToConsumer back in the finally block. commented that I'm not sure this is correct as even an error writing to client will cause msg to be marked delivered to consumer. + On Close ensured that it is only called once. + Had problem where closing browser was causing two CancelOk frames to be sent back to client. RequiredDeliveryException - Added comment to explain incrementReference LocalTransactionalContext - Commented out incrementReference as it shouldn't be required here. NonTransactionalContext - Removed incrementReference on deliver + - Fixed bug where browsers - acks would cause messages to be discarded. new JIRA this needs tidied up. TxnBuffer - Added debug logging. Client ------ AMQQueueBrowser - Added comments AMQSession - Added comments and debug + Updated to cause closed consumer to reject messages rather than receive them. + Prevented NoConsumer's from rollingback and rejecting.. they simply clear their SyncQueue - JIRA to ensure clean state with rollback BasicMessageConsumer - Added trace level debuging on close calls + Forced noConsume-rs to use NO_ACK + added more logging Closeable - Updated to use isClosed rather than directly calling _closed.get() to aid in future work on ensuring multi threaded close still allows pending acks to be processed first. ChannelCloseOkMethodHandler - updated comment AMQProtocolSession - Update comments,whitespace TransportConnection - removed static block FlowControllingBlockingQueue - Added isEmpty() Method PropertyValueTest - Added VM Broker setup + Updated test to run once and 50 times to pull out delivery tag problems that were occuring. + Adjusted logging level to be more helpful. moved some info down to trace and debug. MessageRequeueTest - Moved QpidClientConnection its own file. + Fixed it so it actually runs more than one consumer, concurrently.Now 3 was 1. ConcurrentLinkedMessageQueueAtomicSize - Implemented iterator(). Added QueueBrowserTest to system tests to test QueueBrowsering. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@517638 13f79535-47bb-0310-9956-ffa450edef68
* QPID-403 QPID-346 QPID-355 QPID-386 QPID-389 Updates to fix Transactional ↵Martin Ritchie2007-03-061-14/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rollback. QPID-346 Message loss after rollback\recover QPID-355 Closing a consumer does not ensure messages delivery will stop for that subscription QPID-386 Updated Transactional Tests to cover underlying AMQP/Qpid state. QPID-389 Prefetched message are not correctly returned to the queue QPID-403 Implement Basic.Reject Broker UnacknowledgedMessage - Added toString for debug UnacknowledgedMessageMapImpl - Removed resendMessages method as all sending should go via DeliveryManager and Subscription. AMQChannel - Updated resend and requeue methods so they do not directly write messages to a subscriber. This was violating the suspension state. - Used a local non-transactional context to requeue messages as the internal requeuing of messages on the broker should not be part of any client transaction. - Maked messages as resent. - Removed warnings from IDE about missing JavaDoc text etc. BasicAckMethodHandler - Added debugging BasicRecoverMethodHandler - Removed session from the resend call. BasicRejectMethodHandler - Initial implementation. Hooks left for possible 'resend' bit. ChannelCloseHandler - Fixed bug where channel wasn't marked as fully closed on reception of a close from the client. TxRollbackHandler - Removed session from resend call. AMQMinaProtocolSession - Fixed bug where channel was marked as awaiting closure before it had actually been closed. This causes problems as the close looks up the channel by id again which will return null after it has been marked as awaiting closure. AMQMessage - Initial implementation of Rejection. Currently inactive in hasInterest() as we are miss-using reject to requeue prefetched messages from the client. AMQQueue - Removed debug method as it made reading the log very difficult as all the logs had the same line number ConcurrentSelectorDeliveryManager - Fixed clearAllMessages() as it didn't actually remove the messages. - Fixed bad logic in getNextMessage when using null subscriber. (as done by clearAllMessages) - Added more logging messages. Made more frequent logging a trace value. - Added debugIdentity() method to reduce over head in calculating standard log prefix. - Allowed messages to be added to the front of the queue. - Added currentStatus() to an overview of the queue's current state. SubscriptionImpl - Updated to handle closure correctly (QPID-355) -Updated the deliver method so it doesn't use a try->finally to do msg.setDeliveredToConsumer() as this would be done even in the event of an error. - Created an additional logger to log suspension calls rather than through the SI logger which logs a lot of detail. Client pom.xml - Excluded older version of log4j that commons-collections exposes. AMQSession - Added ability for dispatcher to start in stopped state. - Added dispatcher logger - Added checks around logging - Added message rejection if the dispatcher receives a message that it doesn't have a consumer for. - Updated message rejection to allow the dispatcher to perform the rejection if running this ensures that all queued messages are processed correctly and rejection occurs in order. - rollback() before calling rollback all pending queued messages must be rejected as rollback will clear unacked map which the rejects caused by rollback() will need. - fixed closedProducersAndConsumers so that it will rethrow any JMS Exception - recover() as for rollback() the rejects need to be done before the Recover Call to the broker. - Allowed delclareExchange to be done synchronously programatically - Updated confirmConsumerCancelled to use the dispatcher to perform the clean up. This required the creation of the dispatcher in stopped mode so that it does not start and message attempted to be delivered while the subscriber is being cancelled. BasicMessageConsumer - Updated close not to perform the deregistration. This is done in via BasicCancelOkMethodHandler - Added guards on logging - Record all messages that have been received so they can be rejected if rollback occurs. so had to change impl of acknowledgeLastDelivered. - Updated Rollback to initially reject all received messages that are still unAcked. - Added a recursive call should the queue not be empty at the end of the rollback.. with a warning. BasicCancelOkMethodHandler - White space changes to meet style guide. Added guard on logging. UnprocessedMessage - White space changes to meet style guide. StateWaiter - Added comment about timeout bug. FlowControllingBlockingQueue - Tidied imports RecoverTest - Updated as declareExchange is now Synchronous ChannelCloseTest - added guard on logging MessageRequeueTest - Added to better test underlying AMQP/Qpid state QPID-386 StreamMessageTest - Updated as declareExchange is now Synchronous CommitRollbackTest - added Additional test case to ensure prefetch queue is correctly purged. TransactedTest - Added logging and additional tests. Cluster SimpleClusterTest - updated in line with AMQSession.delcareExchange changes Common AMQConstant - Fixed error code 'not allowed' should be 530 not 507. ConcurrentLinkedMessageQueueAtomicSize - Updated to beable to get the size of messages on the 'head' queue along with additional debug Systests ReturnUnroutableMandatoryMessageTest - Updated as declareExchange is now Synchronous git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@515127 13f79535-47bb-0310-9956-ffa450edef68
* QPID-388 : hand merged the changes done in perftesting branch Bhupendra Bhusman Bhardwaj2007-03-051-1/+5
| | | | | | | QPID-395 : hand merged the changes done in perftesting branch QPID-375 : default queue config properties should now be under <queues> tag git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@514703 13f79535-47bb-0310-9956-ffa450edef68
* QPID-346 Message loss after rollbackMartin Ritchie2007-02-231-88/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPID-348 Problems of prefetching messages QPID-355 Closing a consumer does not ensure messages delivery will stop for that subscription BROKER AMQChannel - updated requeue to either resend via the Delivery Manager not directly via msg.writedeliver. BasicRejectMethodHandler - initial place holder. TxRollbackHandler - Added comment AMQMessage - added ability to record who has taken the message so that it can be resent to that subscriber on resend/requeue. AMQQueue - added the queue reference to the Subscription creation ConcurrentSelectorDeliveryManager - Added methods to correctly monitor the size of queue messages. Including messages on the resend queue of a Subscriber. Additional locking to ensure that messages are not sent to the subscriber after Closure. QPID-355 DeliveryManager - adjusted deliver call to allow delivery to the head of the queue. Subscription - changes to allow selction of queue(resend or predelivery) methods to add to resend and getSendLock to ensure that sending to the Subscription is allowed. SubscriptionFactory - changes to allow the AMQQueue to be passed to the Subscription. SubscriptionImpl - implementation of the interfaces. Local storage of messages to be resent and requeuing of the messages during closure. SubscriptionSet - changes to retrieve the actual stored Subscription when performing removeSubscriber. So we have access to the the resend queue. AMQStateManager - Added BasicRejectMethodHandler TransactionalContext - Added option to deliver the messages to the front of the queue. LocalTransactionalContext - cleared the _postComitDeliveryList on rollback. Added option to deliver the messages to the front of the queue. NonTransactionalContext - Added option to deliver the messages to the front of the queue. DeliverMessageOperation.java DELELTED AS NOT USED. CLIENT AMQSession - added ability to get the pervious state of the dispatcher when settting Stopped, fixed the channel suspension problems on broker so uncommented clean up code in rollback and recover. BasicMessageConsumer - updated the rollback so that it sends reject messages to server. AbstractJMSMessage - whitespace + added extra message properties to the toString() AMQProtocolHandler - whitespace + extra debug output TransactedTest - updated expect to prevent NPEs also added extra logging to help understand what is going on. CLUSTER ClusteredQueue - AMQQueue changes for message deliveryFirst. RemoteSubscriptionImpl - Implementation of Subscription SYSTESTS AbstractHeadersExchangeTestBase - AMQQueue changes for message deliveryFirst. AMQQueueMBeanTest - changes for message deliveryFirst. ConcurrencyTest - changes for message deliveryFirst. DeliveryManagerTest - changes for message deliveryFirst. SubscriptionTestHelper - Implementation of Subscription WhiteSpace only UnacknowledgedMessageMapImpl.java git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@510897 13f79535-47bb-0310-9956-ffa450edef68
* QPID-325 : Persist durable exchange information in the storeRobert Godfrey2007-02-201-2/+17
| | | | | | QPID-318 : Remove hardcoding of version numbers (as applies to store) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@509628 13f79535-47bb-0310-9956-ffa450edef68
* Applied QPID-162 patches from Kevin SmithMartin Ritchie2007-02-141-12/+13
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@507595 13f79535-47bb-0310-9956-ffa450edef68
* QPID-367 Bhupendra Bhusman Bhardwaj2007-02-141-6/+7
| | | | | | added @Configured annotation to the maximumMessageSize attribute git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@507583 13f79535-47bb-0310-9956-ffa450edef68
* QPID-170Bhupendra Bhusman Bhardwaj2007-02-091-38/+57
| | | | | | | predelivery queues will also be cleared with moved messages. Messages will be moved to another queue and predelivery queues of subsribers of another queue will also be populated. the features - removeMmessageFromTop and clearQueue is also modified by using the getNextMessage git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@505268 13f79535-47bb-0310-9956-ffa450edef68
* QPID-170Bhupendra Bhusman Bhardwaj2007-02-071-3/+55
| | | | | | Management feature added - moving messages from one Queue to another git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@504507 13f79535-47bb-0310-9956-ffa450edef68
* QPID-326 : Patch supplied by Rob Godfrey - add oldest message on queue ↵Robert Greig2007-02-051-19/+57
| | | | | | notification, and log notifications in log file git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@503604 13f79535-47bb-0310-9956-ffa450edef68
* QPID-320 : Patch supplied by Rob Godfrey - Improve performance by ↵Robert Greig2007-01-291-2/+10
| | | | | | remembering protocol version git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@501003 13f79535-47bb-0310-9956-ffa450edef68
* QPID-50 : Patch supplied by Rob Godfrey - Virtual Host implementationRobert Greig2007-01-241-52/+55
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@499446 13f79535-47bb-0310-9956-ffa450edef68
* QPID-275 : Patch supplied by Rob Godfrey - Add support for get / purge / qos ↵Robert Greig2007-01-191-32/+107
| | | | | | size / default exchanges and some other small fixes highlighted by the python tests git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@497770 13f79535-47bb-0310-9956-ffa450edef68
* QPID-275 : (Patch supplied by Rob Godfrey) Fixes to allow broker to pass ↵Robert Greig2007-01-101-0/+11
| | | | | | more of the Python tests git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@494769 13f79535-47bb-0310-9956-ffa450edef68
* QPID-255 : Patch Supplied by Rob Godfrey - Change to use bespoke ↵Robert Greig2007-01-081-16/+17
| | | | | | AMQShortString rather than converting to String git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@494121 13f79535-47bb-0310-9956-ffa450edef68
* QPID-32: new model for holding and processing message in memory to support ↵Robert Greig2007-01-071-79/+23
| | | | | | new persistent stores git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@493872 13f79535-47bb-0310-9956-ffa450edef68
* QPID-21 outstanding issues:Martin Ritchie2006-12-201-0/+9
| | | | | | | | | | | | | Fixed an issue where a consumer with no_local set would not have its filters applied to messages. Fixed problem where new consumers would start with an empty PDQ rather than checking the existing queue of messages for messages of interest. AMQQueue.java - Added code check exisiting queue data for messages for the new subscriber with a filter. DeliveryManager.java - added populatePreDeliveryQueue SynchronizedDeliveryManager.java/ConcurrentDeliveryManager.java - implemented new DeliveryManager.java interface SubscriptionImpl.java - fixed issue with no_local subscribers had their filters ignored. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@489070 13f79535-47bb-0310-9956-ffa450edef68
* QPID-216Martin Ritchie2006-12-191-3/+8
| | | | | | | | | | | | | | | | | | BasicConsumeMethodHandler.java - Pulled the nolocal param from the method body and passed down channel to subscription. SubscriptionFactory.java / AMQQueue.java/AMQChannel.java - passed the nolocal parameter through to the Subscription ConnectionStartOkMethodHandler.java - Saved the client properties so the client identifier can be used in comparison with the publisher id to implement no_local AMQMinaProtocolSession.java - added _clientProperties to store the sent client properties. AMQProtocolSession.java - interface changes to get/set ClientProperties ConcurrentSelectorDeliveryManager.java - only need to do hasInterset as this will take care of the hasFilters optimisation check. SubscriptionImpl.java - Added code to do comparison of client ids to determin insterest in a given message. SubscriptionSet.java - tidied up code to use hasInterest as this is where the nolocal is implemented. ConnectionStartMethodHandler.java - Moved literal values to a ClientProperties.java enumeration and a QpidProperties.java values. QpidConnectionMetaData.java - updated to get values from QpidProperties.java MockProtocolSession.java - null implementation of new get/set methods git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@488712 13f79535-47bb-0310-9956-ffa450edef68
* QPID-21Martin Ritchie2006-12-191-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added: SelectorParser.jj - ActiveMQ selector javacc grammar used to generate SelectorParser.java server/filter - Selector Filtering code from ActiveMQ project adjusted to suite our class and package structure. server/message - Decorator classes to allow access to the JMSMessage inside the AMQMessage ConcurrentSelectorDeliveryManager.java - A new DeliveryManager that utilises PreDeliveryQueues to implement selectors AMQInvalidSelectorException.java - thrown on client and broker when the Selector text is invalid. Common: log4j.properties to remove error log4j warnings on Common tests. Modified: broker/pom.xml - to generate SelectorParser.java AMQChannel.java - Addition of argument fieldtable for filter setup. BasicConsumeMethodHandler.java - writing of InvalidSelector channel close exception. AMQMessage.java - Added decorator to get access to the enclosed JMSMessage AMQQueue.java - Enhanced 'deliverymanager' property to allow the selection of the ConcurrentSelectorDeliveryManager. Subscription.java - Enhanced interface to allow a subscription to state an 'interest' in a given message. SubscriptionFactory.java - Added method to allow passing of filter arguments. SubscriptionImpl.java - Implemented new Subscription.java methods. SubscriptionManager.java - Added ability to get a list of current subscribers. SubscriptionSet.java - augmented nextSubscriber to allow the subscriber to exert the new hasInterest feature. SynchronizedDeliveryManager.java - fixed Logging class AMQSession - Added filter extraction from consume call and pass it on to the registration. ChannelCloseMethodHandler.java - Handle the reception and correct raising of the InvalidSelector Exception AbstractJMSMessage.java - Expanded imports BlockingMethodFrameListener.java - added extra info to a debug output line. SocketTransportConnection.java - made output an info not a warn. PropertiesFileInitialContextFactory.java - updated to allow the PROVIDER_URL to specify a property file to read in for the initial values. ClusteredSubscriptionManager.java - Implementation of SubscriptionSet.java NestedSubscriptionManager.java - Implementation of SubscriptionManager.java RemoteSubscriptionImpl.java - Implementation Subscription.java AMQConstant.java - Added '322' "Invalid Selector" SubscriptionTestHelper.java - Implementation of Subscription.java Edited specs/amqp-8.0.xml to add field table to consume method. Thanks to the ActiveMQ project for writing the initial SelectorParser.jj and associated filter Expressions. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@488624 13f79535-47bb-0310-9956-ffa450edef68
* QPID-190 Bhupendra Bhusman Bhardwaj2006-12-141-331/+98
| | | | | | Refactored the broker MBean classes git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@487268 13f79535-47bb-0310-9956-ffa450edef68
* QPID-129 Bhupendra Bhusman Bhardwaj2006-11-271-184/+111
| | | | | | MBeans updated with improved features, like AMQQueue mbean now has separate features for sending message header and message content. ( other details are in JIRA) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@479686 13f79535-47bb-0310-9956-ffa450edef68
* Changed logging from warn to infoMartin Ritchie2006-11-221-25/+30
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@478264 13f79535-47bb-0310-9956-ffa450edef68
* directory moves required for maven mergeStephen Vinoski2006-11-181-0/+867
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@476414 13f79535-47bb-0310-9956-ffa450edef68