List of usage examples for org.springframework.jms.listener.endpoint JmsActivationSpecConfig getPrefetchSize
public int getPrefetchSize()
From source file:org.springframework.jms.listener.endpoint.DefaultJmsActivationSpecFactory.java
/** * This implementation supports Spring's extended "maxConcurrency" * and "prefetchSize" settings through detecting corresponding * ActivationSpec properties: "maxSessions"/"maxNumberOfWorks" and * "maxMessagesPerSessions"/"maxMessages", respectively * (following ActiveMQ's and JORAM's naming conventions). *//* w ww . ja v a 2 s . c o m*/ @Override protected void populateActivationSpecProperties(BeanWrapper bw, JmsActivationSpecConfig config) { super.populateActivationSpecProperties(bw, config); if (config.getMaxConcurrency() > 0) { if (bw.isWritableProperty("maxSessions")) { // ActiveMQ bw.setPropertyValue("maxSessions", Integer.toString(config.getMaxConcurrency())); } else if (bw.isWritableProperty("maxNumberOfWorks")) { // JORAM bw.setPropertyValue("maxNumberOfWorks", Integer.toString(config.getMaxConcurrency())); } else if (bw.isWritableProperty("maxConcurrency")) { // WebSphere bw.setPropertyValue("maxConcurrency", Integer.toString(config.getMaxConcurrency())); } } if (config.getPrefetchSize() > 0) { if (bw.isWritableProperty("maxMessagesPerSessions")) { // ActiveMQ bw.setPropertyValue("maxMessagesPerSessions", Integer.toString(config.getPrefetchSize())); } else if (bw.isWritableProperty("maxMessages")) { // JORAM bw.setPropertyValue("maxMessages", Integer.toString(config.getPrefetchSize())); } else if (bw.isWritableProperty("maxBatchSize")) { // WebSphere bw.setPropertyValue("maxBatchSize", Integer.toString(config.getPrefetchSize())); } } }