spring integration - jpa inbound-channel-adapter doesn't support parameter source -
i trying use parameter-source provide parameter query in inbound-channel-adapter doesn't seem work. have looked through parser code , don't think processing parameter-source.
<int-jpa:inbound-channel-adapter delete-after-poll="true" delete-in-batch="true" auto-startup="true" flush-after-delete="true" max-results="2000" entity-manager-factory="entitymanagerfactory" entity-class="auditmessage" channel="processmessage" jpa-query="select auditmessage a.updatets < :purgedate" parameter-source="parametersource"> <int:poller cron="*/5 * * * * *" > <int:transactional transaction-manager="transactionmanager"/> </int:poller> </int-jpa:inbound-channel-adapter> <bean id="parametersource" factory-bean="spelsource" factory-method="createparametersourcenocache"> <constructor-arg value="" /> </bean> <bean id="spelsource" class="org.springframework.integration.jdbc.expressionevaluatingsqlparametersourcefactory"> <property name="parameterexpressions"> <map> <entry key="purgedate" value="new java.sql.timestamp(t(system).currenttimemillis()-(t(java.util.concurrent.timeunit).milliseconds.convert(${eam.integration.arcgis.purge.daystokeep}, t(java.util.concurrent.timeunit).days)))" /> </map> </property> </bean>
i following exception:
error [task-scheduler-9] [java.lang.illegalargumentexception: query has parameters no parameter source provided @ org.springframework.integration.jpa.core.defaultjpaoperations.setparametersifrequired(defaultjpaoperations.java:330) @ org.springframework.integration.jpa.core.defaultjpaoperations.getquery(defaultjpaoperations.java:114) @ org.springframework.integration.jpa.core.defaultjpaoperations.getresultlistforquery(defaultjpaoperations.java:186) @ org.springframework.integration.jpa.core.jpaexecutor.dopoll(jpaexecutor.java:396)...
i on spring version 4.0.3. doing wrong? or there way provide query parameters?
i think you've found bug!
the jpainboundchanneladapterparser
doesn't parse parameter-source
attrbiute. feel free raise jira bug.
as workaround must configure jpapollingchanneladapter
raw <bean>
injection of jpaexecutor
, use ref
generic <int:inbound-channel-adapter>
.
the jira ticket track.
Comments
Post a Comment