Announcement Announcement Module
Collapse
No announcement yet.
some problem about prefetch and txsize Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • some problem about prefetch and txsize

    Today I test the prefetch and txsize,but I find a problem as follows
    this is my configuration
    Code:
    <rabbit:listener-container id="ocrWorker"
    		concurrency="2" connection-factory="rabbitConnectionFactory"
    		prefetch="3" transaction-manager="rabbitTransactionManager"
    		transaction-size="20" auto-startup="false" message-converter="orcMessageConvert" >
    		<rabbit:listener method="doMessageQueueWork"
    			queue-names="queue.etlOcrServer.recognize" ref="ocrListener" />
    	</rabbit:listener-container>
    this is my rabbitmq server pic ,the prefetch and txsize recording on the server not equals with the configuration
    Attachment

    but the value of Prefetch count in rabbitServer equals with the transaction-size,not prefetch.Could you explain the reason.In my opinion ,transaction-size,means if the amount of client processing the message succefully reach the value,client will send ack to server,it can make server works better instead of sending a ack per message.The prefetch means client can get some messages saving on the local machine,and the mq server will wait for the ack reaching.Is my opinions correct?
    Attached Files

  • #2
    See the java doc; the prefetch should always be greater or equal to the transaction size.

    Code:
    	/**
    	 * Tells the broker how many messages to send to each consumer in a single request. Often this can be set quite high
    	 * to improve throughput. It should be greater than or equal to {@link #setTxSize(int) the transaction size}.
    	 *
    	 * @param prefetchCount the prefetch count
    	 */

    Comment


    • #3
      Thanks I forget the relationship

      Comment

      Working...
      X