You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2011/08/17 03:55:58 UTC
svn commit: r1158487 -
/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala
Author: chirino
Date: Wed Aug 17 01:55:57 2011
New Revision: 1158487
URL: http://svn.apache.org/viewvc?rev=1158487&view=rev
Log:
Allow passing in a null router. This means the the message will NOT get persisted before it gets passed to the targets.
Modified:
activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala
Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala?rev=1158487&r1=1158486&r2=1158487&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Router.scala Wed Aug 17 01:55:57 2011
@@ -72,11 +72,15 @@ object DeliveryProducerRoute extends Log
/**
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
*/
-abstract class DeliveryProducerRoute(val router:Router) extends BaseRetained with BindableDeliveryProducer with Sink[Delivery] {
-
+abstract class DeliveryProducerRoute(router:Router) extends BaseRetained with BindableDeliveryProducer with Sink[Delivery] {
import DeliveryProducerRoute._
var targets = List[DeliverySession]()
+ val store = if(router!=null) {
+ router.virtual_host.store
+ } else {
+ null
+ }
def connected() = dispatch_queue {
on_connected
@@ -151,9 +155,10 @@ abstract class DeliveryProducerRoute(val
// only deliver to matching consumers
if( target.consumer.matches(copy) ) {
- if( router.virtual_host.store !=null && copy.storeKey == -1L && target.consumer.is_persistent && copy.message.persistent ) {
- if( copy.uow==null ) {
- copy.uow = router.virtual_host.store.create_uow
+ if ( target.consumer.is_persistent && copy.message.persistent
+ && copy.storeKey == -1L && store != null) {
+ if (copy.uow == null) {
+ copy.uow = store.create_uow
} else {
copy.uow.retain
}