Announcement Announcement Module
Collapse
No announcement yet.
Transactional Poller with max-message-per-poll > 1 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Transactional Poller with max-message-per-poll > 1

    Hi,

    when using a transsctional poller with max-message-per-poll > 1 will each polled message get its own transaction / its own processing thread?

    I cannot find something in the documentation about this aspect. But the source code of AbstractPollingEndpoint contains this loop
    Code:
    while (initialized && (maxMessagesPerPoll <= 0 || count < maxMessagesPerPoll)) {
    	try {
    		if (!pollingTask.call()) {
    			break;
    		}
    		count++;
    	}
    	catch (Exception e) {
    		if (e instanceof RuntimeException) {
    			throw (RuntimeException) e;
    		}
    		else {
    			throw new MessageHandlingException(new ErrorMessage(e));
    		}
    	}
    }
    in the Poller implementation. The transactional advice is weaved into then polling task, but the whole polling look is executed in only a single Runnable.

    This means there is only one transaction for all pollingTasks.

    Am I right?

    br, steve

  • #2
    No; each invocation of pollableTask.call() starts (and completes) a new transaction.

    When max-messages-per-poll == n, up to n messages will be processed serially on the same thread, each in a separate transaction.

    Comment

    Working...
    X