I'm migrating from Spring AMQP inetgration from 2.2.3.RELEASE to 5.5.20.and this is my mvn dependency tree matrix.
[INFO] | +- org.springframework.integration:spring-integration-stream:jar:5.5.20:compile
[INFO] | +- org.springframework.integration:spring-integration-amqp:jar:5.5.20:compile
[INFO] | | \- org.springframework.amqp:spring-rabbit:jar:2.3.16:compile
[INFO] | | +- org.springframework.amqp:spring-amqp:jar:2.3.16:compile
[INFO] | | \- com.rabbitmq:amqp-client:jar:5.9.0:compile
As per the document it should work as expected and document also refers to same version checkout xml configs. https://docs.spring.io/spring-integration/docs/5.5.20/reference/html/amqp.html#amqp-inbound-channel-adapter
means all the attributes are still present in the latest version.
<int-amqp:inbound-channel-adapter
id="amqpAdapter" channel="amqpChatQ"
queue-names="${amqp.queue.v1}" connection-factory="connectionFactory"
auto-startup="true" concurrent-consumers="${amqp.consumer.count}"
channel-transacted="true" task-executor="taskExecutor"
prefetch-count="2" tx-size="2" acknowledge-mode="AUTO"
error-handler="messageErrorHandler" />
but I referred few documents there its says tx-size="2" has been deprecated and move to batch-size https://github.com/spring-projects/spring-integration/issues/9695 but if I use batch-size its not allowed on <int-amqp:inbound-channel-adapter
still not able figure out using documents if anyone provides some inputs will be very helpful.
Is that okay if we have configuration like with this I dont see any issues
<bean id="customAmqpListenerContainer" class="org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer">
<property name="connectionFactory" ref="connectionFactory" />
<property name="autoStartup" value="true" />
<property name="queueNames" value="${amqp.queue.v1}" />
<property name="concurrentConsumers" value="${amqp.consumer.count}" />
<property name="channelTransacted" value="true" />
----
</bean>
<int-amqp:inbound-channel-adapter
id="amqpAdapter"
channel="amqpChatQ"
listener-container="customAmqpListenerContainer" />
The fix you are mentioning is new and really does not belong to Spring Integration 5.5.20
. This version is out of support for long time. Consider to upgrade to the latest supported: https://spring.io/projects/spring-integration#learn.
Yes, the listener-container
reference fully replaces all those individual attributes. And I believe you really can use there batchSize
property on the SimpleMessageListenerContainer
bean definition.
This is somehow related to your other question: Migrating spring from 4.x to 5.x and jdk 17. Someone may find this your new one as a duplication of that one. I'm not sure why have you took answer acceptance since what we have discussed there is resolved. That is not how community works here even if you still have some problems. The shorter scope, the better to digest for any one who would face similar problem. Taking answer away might mislead community and would raise another SO question.