You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Christopher L. Shannon (JIRA)" <ji...@apache.org> on 2016/06/13 12:45:21 UTC

[jira] [Commented] (AMQ-6318) policyEntry doesn't handle wildcards properly

    [ https://issues.apache.org/jira/browse/AMQ-6318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15327281#comment-15327281 ] 

Christopher L. Shannon commented on AMQ-6318:
---------------------------------------------

[~gtully] and [~tabish121],

I have noticed this filtering issue before when I was working on some policy stuff.  For example, I would expect the following code would work but it actually fails as the map returns a value which seems odd as the entry specifies a decendent and the value passed to get() doesn't have a descendent:
{code:java}
DestinationMap map = new DestinationMap();
map.put(new ActiveMQQueue("value.>"), "");
assertTrue(map.get(new ActiveMQQueue("value")) == null);
{code}

There's a comment on line 255 of the DestinationMapNode class which seems to indicate that this is intentional so I left it alone in the past but I wanted to see what you guys thought about this behavior as it doesn't seem right to me in this case.

> policyEntry doesn't handle wildcards properly
> ---------------------------------------------
>
>                 Key: AMQ-6318
>                 URL: https://issues.apache.org/jira/browse/AMQ-6318
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.13.3
>            Reporter: Jaume Teixi
>
> Just trying to setup a policyEntry for a limit of pending messages in a topic "customer01.data.value" where an application is writing messages to just realized that the wildcards seems to not to being handled properly.
> {code:xml}
>         <destinationPolicy>
>             <policyMap>
>               <policyEntries>
>                 <policyEntry topic=">" >
>                     <!-- The constantPendingMessageLimitStrategy is used to prevent
>                          slow topic consumers to block producers and affect other consumers
>                          by limiting the number of messages that are retained
>                          For more information, see:
>                          http://activemq.apache.org/slow-consumer-handling.html
>                     -->
>                   <pendingMessageLimitStrategy>
>                     <constantPendingMessageLimitStrategy limit="1000"/>
>                   </pendingMessageLimitStrategy>
>                 </policyEntry>
> 				<policyEntry topic="*.data.>" topicPrefetch="1" durableTopicPrefetch="1">
> 					<pendingMessageLimitStrategy>
> 						<constantPendingMessageLimitStrategy limit="10"/>
> 					</pendingMessageLimitStrategy>
> 				</policyEntry>             
>               </policyEntries>
>             </policyMap>
>         </destinationPolicy>
> {code}
> Above causes inconsistencies on all the topics receiving messages that even didn't match the wildcard naming ie. "customer01.in.data"
> Tried also with: 
> {code:xml}
> <policyEntry topic="customer01.data.>" topicPrefetch="1" durableTopicPrefetch="1">
> 					<pendingMessageLimitStrategy>
> 						<constantPendingMessageLimitStrategy limit="10"/>
> 					</pendingMessageLimitStrategy>
> 				</policyEntry> 
> {code}
> and with: 
> {code:xml}
> <policyEntry topic="customer01.data.value" topicPrefetch="1" durableTopicPrefetch="1">
> 					<pendingMessageLimitStrategy>
> 						<constantPendingMessageLimitStrategy limit="10"/>
> 					</pendingMessageLimitStrategy>
> 				</policyEntry> 
> {code}
> Last two above didn't caused inconsistencies on the topics that didn't match the naming but anyway didn't made the limit strategy of pending messages for the topic "customer01.data.value"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)