简体   繁体   中英

How to configure JBoss/JMS message rate limit / flow control

I've got a fast producer ESB (converts CSV to XML) and a slow consumer ESB (performing zip/base64/SOAP wrapping of the XML). The ESBs communicate via a JMS topic. This design is legacy and cannot be changed. When a large CSV file is processed, JBoss AS (5.2) grinds to a halt as the producer is flooding out the consumer, this is even with a heap-size of 4096M. Forgive me I'm new to JBoss/JMS and finding it all bewildering.

Producer sending config

<action class="com.example.FooAction" name="ProcessFoo">
    <property name="springJndiLocation" value="FooEsbSpring" />
    <property name="exceptionMethod" value="exceptionHandler" />
    <property name="okMethod" value="processSuccess" />
    <property name="jndiName" value="topic/FooTopic" />
    <property name="connection-factory" value="ConnectionFactory" />
    <property name="unwrap" value="true" />
    <property name="security-principal" value="guest" />
    <property name="security-credential" value="guest" />
</action>

Producer sending code:

Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
msg.getBody().add(foo); // foo is the business specific message
new JMSRouter(config).process(msg);

Consumer receiving config:

<jms-jca-provider connection-factory="ConnectionFactory" name="FooMessaging">
    <jms-bus busid="fooChannel">
        <jms-message-filter dest-name="topic/FooTopic"
            dest-type="TOPIC" transacted="false" />
    </jms-bus>
    <activation-config>
        <property name="dLQMaxResent" value="1" />
    </activation-config>
</jms-jca-provider>

Topic config

<server>
<mbean code="org.jboss.jms.server.destination.TopicService"
    name="jboss.esb.quickstart.destination:service=Topic,name=FooTopic"
    xmbean-dd="xmdesc/Queue-xmbean.xml">
    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
    </depends>
    <depends>jboss.messaging:service=PostOffice</depends>
</mbean>
</server>

Things I've tried so far.

  • Run the publisher ESB without the consumer ESB - as expected no problems.
  • Lots of googling, looking for existing questions on stackoverflow
  • Found some references to rate limiting but I can't see how to fit these into my config.
  • I've tried to find an API to discover how many messages are already on the topic unprocessed (with the hope I can implement my own back-off strategy).
  • Looked at this documentation .

Look at this section 6.3.17.2. org.jboss.mq.server.jmx.Topic and use the 'Depth' related attributes using JMX.

It might help you build the back-off strategy you're looking for

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM