You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Brad Willard (JIRA)" <ji...@apache.org> on 2010/04/03 00:23:08 UTC

[jira] Created: (AMQ-2683) Producer Flow Control Does Not Seem to Work with Topics

Producer Flow Control Does Not Seem to Work with Topics
-------------------------------------------------------

                 Key: AMQ-2683
                 URL: https://issues.apache.org/activemq/browse/AMQ-2683
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.3.1, 5.3.0
         Environment: Windows 2008 Server, Sun Java 6. 
            Reporter: Brad Willard
            Priority: Minor


I have multiple producers posting messages to queues and adding statistical information to a topic.  I have one consumer of that topic subscribing and taking those messages and monitors for problems.  The consumer is slower than publishing to the topic.  I have flow control enabled and I expected that once the memory limit of the Consumers dispatch queue was reached it would throttle the publishers to the topic, but instead it seems to lock everything up.

The message producers are putting messages to each queue and the topic on separate sessions.  The broker basically stops once it posts the message that it's going to throttle producers.  The topic messages are messages with text attributes, they are non persistent and posted non-transactional using the AUTO_ACKNOWLEDGE mode.

All the producers and consumers use the same Connection factory with with these attributes set.

ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(brokerURI);
factory.setProducerWindowSize(1024 * 1024);
factory.getPrefetchPolicy().setTopicPrefetch(10);


My activemq config is as follows:

    <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data" destroyApplicationContextOnStop="true">
 
        <!--
			For better performances use VM cursor and small memory limit.
			For more information, see:
            
            http://activemq.apache.org/message-cursors.html
            
            Also, if your producer is "hanging", it's probably due to producer flow control.
            For more information, see:
            http://activemq.apache.org/producer-flow-control.html
        -->
              
        <destinationPolicy>
            <policyMap>
              <policyEntries>
                <policyEntry topic=">" producerFlowControl="true" memoryLimit="15mb">
                  <pendingSubscriberPolicy>
                    <vmCursor />
                  </pendingSubscriberPolicy>
                </policyEntry>
                <policyEntry queue=">" producerFlowControl="true" memoryLimit="15mb">
                  <!-- Use VM cursor for better latency
                       For more information, see:
                       
                       http://activemq.apache.org/message-cursors.html
                       
                  <pendingQueuePolicy>
                    <vmQueueCursor/>
                  </pendingQueuePolicy>
                  -->
                </policyEntry>
              </policyEntries>
            </policyMap>
        </destinationPolicy> 
 
        
        <!-- 
            The managementContext is used to configure how ActiveMQ is exposed in 
            JMX. By default, ActiveMQ uses the MBean server that is started by 
            the JVM. For more information, see: 
            
            http://activemq.apache.org/jmx.html 
        -->
        <managementContext>
            <managementContext createConnector="false"/>
        </managementContext>

        <!-- 
            Configure message persistence for the broker. The default persistence
            mechanism is the KahaDB store (identified by the kahaDB tag). 
            For more information, see: 
            
            http://activemq.apache.org/persistence.html 
        -->
        <persistenceAdapter>
            <kahaDB directory="${activemq.base}/data/kahadb" journalMaxFileLength="5 mb"/>
        </persistenceAdapter>
        
        
        <!--
            The systemUsage controls the maximum amount of space the broker will 
            use before slowing down producers. For more information, see:
            
            http://activemq.apache.org/producer-flow-control.html
        -->     
        <systemUsage>
            <systemUsage>
                <memoryUsage>
                    <memoryUsage limit="200 mb"/>
                </memoryUsage>
                <storeUsage>
                    <storeUsage limit="50 gb"/>
                </storeUsage>
                <tempUsage>
                    <tempUsage limit="100 mb"/>
                </tempUsage>
            </systemUsage>
        </systemUsage>
	
		  
        <!-- 
            The transport connectors expose ActiveMQ over a given protocol to
            clients and other brokers. For more information, see: 
            
            http://activemq.apache.org/configuring-transports.html 
        -->
        <transportConnectors>
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
        </transportConnectors>

    </broker>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2683) Producer Flow Control Does Not Seem to Work with Topics

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60653#action_60653 ] 

Gary Tully commented on AMQ-2683:
---------------------------------

could you build a test case that can demonstrate, possibly a topic version of http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ProducerFlowControlTest.java?view=markup

> Producer Flow Control Does Not Seem to Work with Topics
> -------------------------------------------------------
>
>                 Key: AMQ-2683
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2683
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0, 5.3.1
>         Environment: Windows 2008 Server, Sun Java 6. 
>            Reporter: Brad Willard
>            Priority: Minor
>             Fix For: 5.4.1
>
>
> I have multiple producers posting messages to queues and adding statistical information to a topic.  I have one consumer of that topic subscribing and taking those messages and monitors for problems.  The consumer is slower than publishing to the topic.  I have flow control enabled and I expected that once the memory limit of the Consumers dispatch queue was reached it would throttle the publishers to the topic, but instead it seems to lock everything up.
> The message producers are putting messages to each queue and the topic on separate sessions.  The broker basically stops once it posts the message that it's going to throttle producers.  The topic messages are messages with text attributes, they are non persistent and posted non-transactional using the AUTO_ACKNOWLEDGE mode.
> All the producers and consumers use the same Connection factory with with these attributes set.
> ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(brokerURI);
> factory.setProducerWindowSize(1024 * 1024);
> factory.getPrefetchPolicy().setTopicPrefetch(10);
> My activemq config is as follows:
>     <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data" destroyApplicationContextOnStop="true">
>  
>         <!--
> 			For better performances use VM cursor and small memory limit.
> 			For more information, see:
>             
>             http://activemq.apache.org/message-cursors.html
>             
>             Also, if your producer is "hanging", it's probably due to producer flow control.
>             For more information, see:
>             http://activemq.apache.org/producer-flow-control.html
>         -->
>               
>         <destinationPolicy>
>             <policyMap>
>               <policyEntries>
>                 <policyEntry topic=">" producerFlowControl="true" memoryLimit="15mb">
>                   <pendingSubscriberPolicy>
>                     <vmCursor />
>                   </pendingSubscriberPolicy>
>                 </policyEntry>
>                 <policyEntry queue=">" producerFlowControl="true" memoryLimit="15mb">
>                   <!-- Use VM cursor for better latency
>                        For more information, see:
>                        
>                        http://activemq.apache.org/message-cursors.html
>                        
>                   <pendingQueuePolicy>
>                     <vmQueueCursor/>
>                   </pendingQueuePolicy>
>                   -->
>                 </policyEntry>
>               </policyEntries>
>             </policyMap>
>         </destinationPolicy> 
>  
>         
>         <!-- 
>             The managementContext is used to configure how ActiveMQ is exposed in 
>             JMX. By default, ActiveMQ uses the MBean server that is started by 
>             the JVM. For more information, see: 
>             
>             http://activemq.apache.org/jmx.html 
>         -->
>         <managementContext>
>             <managementContext createConnector="false"/>
>         </managementContext>
>         <!-- 
>             Configure message persistence for the broker. The default persistence
>             mechanism is the KahaDB store (identified by the kahaDB tag). 
>             For more information, see: 
>             
>             http://activemq.apache.org/persistence.html 
>         -->
>         <persistenceAdapter>
>             <kahaDB directory="${activemq.base}/data/kahadb" journalMaxFileLength="5 mb"/>
>         </persistenceAdapter>
>         
>         
>         <!--
>             The systemUsage controls the maximum amount of space the broker will 
>             use before slowing down producers. For more information, see:
>             
>             http://activemq.apache.org/producer-flow-control.html
>         -->     
>         <systemUsage>
>             <systemUsage>
>                 <memoryUsage>
>                     <memoryUsage limit="200 mb"/>
>                 </memoryUsage>
>                 <storeUsage>
>                     <storeUsage limit="50 gb"/>
>                 </storeUsage>
>                 <tempUsage>
>                     <tempUsage limit="100 mb"/>
>                 </tempUsage>
>             </systemUsage>
>         </systemUsage>
> 	
> 		  
>         <!-- 
>             The transport connectors expose ActiveMQ over a given protocol to
>             clients and other brokers. For more information, see: 
>             
>             http://activemq.apache.org/configuring-transports.html 
>         -->
>         <transportConnectors>
>             <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
>         </transportConnectors>
>     </broker>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2683) Producer Flow Control Does Not Seem to Work with Topics

Posted by "Steve Pietrowicz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60638#action_60638 ] 

Steve Pietrowicz commented on AMQ-2683:
---------------------------------------

I'm seeing this same issue, same results.

> Producer Flow Control Does Not Seem to Work with Topics
> -------------------------------------------------------
>
>                 Key: AMQ-2683
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2683
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0, 5.3.1
>         Environment: Windows 2008 Server, Sun Java 6. 
>            Reporter: Brad Willard
>            Priority: Minor
>             Fix For: 5.4.1
>
>
> I have multiple producers posting messages to queues and adding statistical information to a topic.  I have one consumer of that topic subscribing and taking those messages and monitors for problems.  The consumer is slower than publishing to the topic.  I have flow control enabled and I expected that once the memory limit of the Consumers dispatch queue was reached it would throttle the publishers to the topic, but instead it seems to lock everything up.
> The message producers are putting messages to each queue and the topic on separate sessions.  The broker basically stops once it posts the message that it's going to throttle producers.  The topic messages are messages with text attributes, they are non persistent and posted non-transactional using the AUTO_ACKNOWLEDGE mode.
> All the producers and consumers use the same Connection factory with with these attributes set.
> ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(brokerURI);
> factory.setProducerWindowSize(1024 * 1024);
> factory.getPrefetchPolicy().setTopicPrefetch(10);
> My activemq config is as follows:
>     <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data" destroyApplicationContextOnStop="true">
>  
>         <!--
> 			For better performances use VM cursor and small memory limit.
> 			For more information, see:
>             
>             http://activemq.apache.org/message-cursors.html
>             
>             Also, if your producer is "hanging", it's probably due to producer flow control.
>             For more information, see:
>             http://activemq.apache.org/producer-flow-control.html
>         -->
>               
>         <destinationPolicy>
>             <policyMap>
>               <policyEntries>
>                 <policyEntry topic=">" producerFlowControl="true" memoryLimit="15mb">
>                   <pendingSubscriberPolicy>
>                     <vmCursor />
>                   </pendingSubscriberPolicy>
>                 </policyEntry>
>                 <policyEntry queue=">" producerFlowControl="true" memoryLimit="15mb">
>                   <!-- Use VM cursor for better latency
>                        For more information, see:
>                        
>                        http://activemq.apache.org/message-cursors.html
>                        
>                   <pendingQueuePolicy>
>                     <vmQueueCursor/>
>                   </pendingQueuePolicy>
>                   -->
>                 </policyEntry>
>               </policyEntries>
>             </policyMap>
>         </destinationPolicy> 
>  
>         
>         <!-- 
>             The managementContext is used to configure how ActiveMQ is exposed in 
>             JMX. By default, ActiveMQ uses the MBean server that is started by 
>             the JVM. For more information, see: 
>             
>             http://activemq.apache.org/jmx.html 
>         -->
>         <managementContext>
>             <managementContext createConnector="false"/>
>         </managementContext>
>         <!-- 
>             Configure message persistence for the broker. The default persistence
>             mechanism is the KahaDB store (identified by the kahaDB tag). 
>             For more information, see: 
>             
>             http://activemq.apache.org/persistence.html 
>         -->
>         <persistenceAdapter>
>             <kahaDB directory="${activemq.base}/data/kahadb" journalMaxFileLength="5 mb"/>
>         </persistenceAdapter>
>         
>         
>         <!--
>             The systemUsage controls the maximum amount of space the broker will 
>             use before slowing down producers. For more information, see:
>             
>             http://activemq.apache.org/producer-flow-control.html
>         -->     
>         <systemUsage>
>             <systemUsage>
>                 <memoryUsage>
>                     <memoryUsage limit="200 mb"/>
>                 </memoryUsage>
>                 <storeUsage>
>                     <storeUsage limit="50 gb"/>
>                 </storeUsage>
>                 <tempUsage>
>                     <tempUsage limit="100 mb"/>
>                 </tempUsage>
>             </systemUsage>
>         </systemUsage>
> 	
> 		  
>         <!-- 
>             The transport connectors expose ActiveMQ over a given protocol to
>             clients and other brokers. For more information, see: 
>             
>             http://activemq.apache.org/configuring-transports.html 
>         -->
>         <transportConnectors>
>             <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
>         </transportConnectors>
>     </broker>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQ-2683) Producer Flow Control Does Not Seem to Work with Topics

Posted by "Bruce Snyder (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2683?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bruce Snyder updated AMQ-2683:
------------------------------

    Fix Version/s: 5.5.0
                       (was: 5.4.1)

> Producer Flow Control Does Not Seem to Work with Topics
> -------------------------------------------------------
>
>                 Key: AMQ-2683
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2683
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0, 5.3.1
>         Environment: Windows 2008 Server, Sun Java 6. 
>            Reporter: Brad Willard
>            Priority: Minor
>             Fix For: 5.5.0
>
>
> I have multiple producers posting messages to queues and adding statistical information to a topic.  I have one consumer of that topic subscribing and taking those messages and monitors for problems.  The consumer is slower than publishing to the topic.  I have flow control enabled and I expected that once the memory limit of the Consumers dispatch queue was reached it would throttle the publishers to the topic, but instead it seems to lock everything up.
> The message producers are putting messages to each queue and the topic on separate sessions.  The broker basically stops once it posts the message that it's going to throttle producers.  The topic messages are messages with text attributes, they are non persistent and posted non-transactional using the AUTO_ACKNOWLEDGE mode.
> All the producers and consumers use the same Connection factory with with these attributes set.
> ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(brokerURI);
> factory.setProducerWindowSize(1024 * 1024);
> factory.getPrefetchPolicy().setTopicPrefetch(10);
> My activemq config is as follows:
>     <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.base}/data" destroyApplicationContextOnStop="true">
>  
>         <!--
> 			For better performances use VM cursor and small memory limit.
> 			For more information, see:
>             
>             http://activemq.apache.org/message-cursors.html
>             
>             Also, if your producer is "hanging", it's probably due to producer flow control.
>             For more information, see:
>             http://activemq.apache.org/producer-flow-control.html
>         -->
>               
>         <destinationPolicy>
>             <policyMap>
>               <policyEntries>
>                 <policyEntry topic=">" producerFlowControl="true" memoryLimit="15mb">
>                   <pendingSubscriberPolicy>
>                     <vmCursor />
>                   </pendingSubscriberPolicy>
>                 </policyEntry>
>                 <policyEntry queue=">" producerFlowControl="true" memoryLimit="15mb">
>                   <!-- Use VM cursor for better latency
>                        For more information, see:
>                        
>                        http://activemq.apache.org/message-cursors.html
>                        
>                   <pendingQueuePolicy>
>                     <vmQueueCursor/>
>                   </pendingQueuePolicy>
>                   -->
>                 </policyEntry>
>               </policyEntries>
>             </policyMap>
>         </destinationPolicy> 
>  
>         
>         <!-- 
>             The managementContext is used to configure how ActiveMQ is exposed in 
>             JMX. By default, ActiveMQ uses the MBean server that is started by 
>             the JVM. For more information, see: 
>             
>             http://activemq.apache.org/jmx.html 
>         -->
>         <managementContext>
>             <managementContext createConnector="false"/>
>         </managementContext>
>         <!-- 
>             Configure message persistence for the broker. The default persistence
>             mechanism is the KahaDB store (identified by the kahaDB tag). 
>             For more information, see: 
>             
>             http://activemq.apache.org/persistence.html 
>         -->
>         <persistenceAdapter>
>             <kahaDB directory="${activemq.base}/data/kahadb" journalMaxFileLength="5 mb"/>
>         </persistenceAdapter>
>         
>         
>         <!--
>             The systemUsage controls the maximum amount of space the broker will 
>             use before slowing down producers. For more information, see:
>             
>             http://activemq.apache.org/producer-flow-control.html
>         -->     
>         <systemUsage>
>             <systemUsage>
>                 <memoryUsage>
>                     <memoryUsage limit="200 mb"/>
>                 </memoryUsage>
>                 <storeUsage>
>                     <storeUsage limit="50 gb"/>
>                 </storeUsage>
>                 <tempUsage>
>                     <tempUsage limit="100 mb"/>
>                 </tempUsage>
>             </systemUsage>
>         </systemUsage>
> 	
> 		  
>         <!-- 
>             The transport connectors expose ActiveMQ over a given protocol to
>             clients and other brokers. For more information, see: 
>             
>             http://activemq.apache.org/configuring-transports.html 
>         -->
>         <transportConnectors>
>             <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
>         </transportConnectors>
>     </broker>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.