You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Sanjiv Jivan (JIRA)" <ji...@apache.org> on 2006/06/21 20:10:51 UTC

[jira] Created: (AMQ-769) Expose MessageGroupMap implementation to be configurable via BrokerService property

Expose MessageGroupMap implementation to be configurable via BrokerService property
-----------------------------------------------------------------------------------

         Key: AMQ-769
         URL: https://issues.apache.org/activemq/browse/AMQ-769
     Project: ActiveMQ
        Type: Improvement

  Components: Broker  
    Versions: 4.0    
 Environment: Active MQ 4.0
    Reporter: Sanjiv Jivan


I need to use the SimpleMessageGroupMap implmentation of MessageGroupMap instad of the default MessageGroupHashBucket implmentation. Presently there's no easy way to do this. Additionally the member  "messageGroupOwners" in org.apache.activemq.broker.region.Queue is private, with no setter and the getter has 

    public MessageGroupMap getMessageGroupOwners() {
        if (messageGroupOwners == null) {
            messageGroupOwners = new MessageGroupHashBucket(messageGroupHashBucketCount);
        }
        return messageGroupOwners;
    }

So basically there's no easy way to use another implmentation of MessageGroupMap in this class. (This lazy create method is also not threadsafe. Might be better to default initialize messageGroupOwners )

I had to jump through a bunh of hoops, starting with subclassing BrokerService exposing the messageGroupOwners class, followed by overriding createRegionBroker() where it creates an annonymous subclass of RegionBroker , overriding createQueueRegion and createTempQueueRegion where I create subclasses of  QueueRegion and TempQueueRegion respectively to have them be configured to use the configured MessageGroupMap.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (AMQ-769) Expose MessageGroupMap implementation to be configurable via BrokerService property

Posted by "james strachan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-769?page=all ]

james strachan resolved AMQ-769.
--------------------------------

    Fix Version/s: 4.1
       Resolution: Fixed

I've added a MessageGroupMapFactory strategy to the destination based policy configuration...

http://incubator.apache.org/activemq/per-destination-policies.html

so you can specify something like this...

 <broker>

    <destinationPolicy>
      <policyMap>
        <policyEntries>
          <policyEntry queue=">">
           <messageGroupMapFactory>
            <simpleMessageGroupMapFactory/>
    

> Expose MessageGroupMap implementation to be configurable via BrokerService property
> -----------------------------------------------------------------------------------
>
>                 Key: AMQ-769
>                 URL: https://issues.apache.org/activemq/browse/AMQ-769
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 4.0
>         Environment: Active MQ 4.0
>            Reporter: Sanjiv Jivan
>             Fix For: 4.1
>
>
> I need to use the SimpleMessageGroupMap implmentation of MessageGroupMap instad of the default MessageGroupHashBucket implmentation. Presently there's no easy way to do this. Additionally the member  "messageGroupOwners" in org.apache.activemq.broker.region.Queue is private, with no setter and the getter has 
>     public MessageGroupMap getMessageGroupOwners() {
>         if (messageGroupOwners == null) {
>             messageGroupOwners = new MessageGroupHashBucket(messageGroupHashBucketCount);
>         }
>         return messageGroupOwners;
>     }
> So basically there's no easy way to use another implmentation of MessageGroupMap in this class. (This lazy create method is also not threadsafe. Might be better to default initialize messageGroupOwners )
> I had to jump through a bunh of hoops, starting with subclassing BrokerService exposing the messageGroupOwners class, followed by overriding createRegionBroker() where it creates an annonymous subclass of RegionBroker , overriding createQueueRegion and createTempQueueRegion where I create subclasses of  QueueRegion and TempQueueRegion respectively to have them be configured to use the configured MessageGroupMap.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (AMQ-769) Expose MessageGroupMap implementation to be configurable via BrokerService property

Posted by "james strachan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-769?page=comments#action_36708 ] 
            
james strachan commented on AMQ-769:
------------------------------------

BTW a quick warning about SimpleMessageGroupMap - if you use lots of different message group IDs then there is a chance of a memory leak as they may not be closed down properly by bad JMS clients.

But you are right we need a way to make it easier to supply a different MessageGroupMap implementation. Am working on it right now - should have something soon

> Expose MessageGroupMap implementation to be configurable via BrokerService property
> -----------------------------------------------------------------------------------
>
>                 Key: AMQ-769
>                 URL: https://issues.apache.org/activemq/browse/AMQ-769
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 4.0
>         Environment: Active MQ 4.0
>            Reporter: Sanjiv Jivan
>
> I need to use the SimpleMessageGroupMap implmentation of MessageGroupMap instad of the default MessageGroupHashBucket implmentation. Presently there's no easy way to do this. Additionally the member  "messageGroupOwners" in org.apache.activemq.broker.region.Queue is private, with no setter and the getter has 
>     public MessageGroupMap getMessageGroupOwners() {
>         if (messageGroupOwners == null) {
>             messageGroupOwners = new MessageGroupHashBucket(messageGroupHashBucketCount);
>         }
>         return messageGroupOwners;
>     }
> So basically there's no easy way to use another implmentation of MessageGroupMap in this class. (This lazy create method is also not threadsafe. Might be better to default initialize messageGroupOwners )
> I had to jump through a bunh of hoops, starting with subclassing BrokerService exposing the messageGroupOwners class, followed by overriding createRegionBroker() where it creates an annonymous subclass of RegionBroker , overriding createQueueRegion and createTempQueueRegion where I create subclasses of  QueueRegion and TempQueueRegion respectively to have them be configured to use the configured MessageGroupMap.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira