Results 1 to 3 of 3

Thread: some problem about prefetch and txsize

  1. #1
    Join Date
    Jul 2012
    Posts
    18

    Default 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
    dsdsd.jpg

    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?

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,016

    Default

    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
    	 */
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Jul 2012
    Posts
    18

    Default

    Thanks I forget the relationship

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •