Hi.
Continuing with my past examples.
I´m making a publisher-suscriber. My suscriber is a splitter which consumes from inbound-channel-adapter a list of coffees. The think is that the output channel of the spitter is failing on getting the message.
Here is my spring-context:
In the java part I´veCode:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration" xmlns:int-jdbc="http://www.springframework.org/schema/integration/jdbc" xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd http://www.springframework.org/schema/integration/jdbc http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <bean id="dataSourceRepositorio" class="oracle.jdbc.pool.OracleDataSource" destroy-method="close"> <property name="connectionCachingEnabled" value="true" /> <property name="URL" value="jdbc:oracle:thin:@//localhost:1521/XE" /> <property name="password" value="admin" /> <property name="user" value="admin" /> <property name="connectionCacheProperties"> <props merge="default"> <prop key="MinLimit">3</prop> <prop key="MaxLimit">20</prop> </props> </property> </bean> <int:channel id="findAllProcedureRequestChannel" /> <int:channel id="dbchannel" /> <int:publish-subscribe-channel id="transmitirCoffee" /> <int:gateway id="gateway" default-request-timeout="5000" default-reply-timeout="5000" service-interface="org.springframework.integration.service.CoffeeService"> <int:method name="findAllCoffeeBeverages" request-channel="findAllProcedureRequestChannel" /> <int:method name="insertCoffee" request-channel="dbchannel" /> </int:gateway> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSourceRepositorio"/> </bean> <bean id="coffeeBeverageMapper" class="org.springframework.integration.support.CoffeBeverageMapper" /> <int-jdbc:inbound-channel-adapter id="consultaCoffeeTransmitir" channel="findAllProcedureRequestChannel" data-source="dataSourceRepositorio" query="SELECT id, coffee_name, coffee_description FROM coffee_beverages ORDER BY ID" row-mapper="coffeeBeverageMapper" max-rows-per-poll="100"> <int:poller trigger="trigerConsulta"> <int:transactional propagation="REQUIRED" transaction-manager="transactionManager"/> </int:poller> </int-jdbc:inbound-channel-adapter> <int:splitter id="spliterConsultaTransmitir" output-channel="transmitirCoffee" input-channel="findAllProcedureRequestChannel"/> <bean id="trigerConsulta" class="org.springframework.scheduling.support.PeriodicTrigger"> <constructor-arg name="period" value="15000"/> <property name="initialDelay" value="10000"/> </bean> </beans>
So when I run it I get:Code:final AbstractApplicationContext context = new ClassPathXmlApplicationContext("classpath:META-INF/spring/integration/*-context.xml"); context.registerShutdownHook();
Why is the splitter failing on getting the message?Code:ERROR [task-scheduler-1][org.springframework.integration.handler.LoggingHandler] org.springframework.integration.MessageDeliveryException: failed to send message to channel 'transmitirCoffee' within timeout: -1 at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:292) at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149) at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendMessage(AbstractReplyProducingMessageHandler.java:216) at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendReplyMessage(AbstractReplyProducingMessageHandler.java:200) at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.produceReply(AbstractReplyProducingMessageHandler.java:165) at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleResult(AbstractReplyProducingMessageHandler.java:155) at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:141) at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:73) at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:115) at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:102) at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77) at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157) at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:128) at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288) at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149) at org.springframework.integration.endpoint.SourcePollingChannelAdapter.handleMessage(SourcePollingChannelAdapter.java:97) at org.springframework.integration.endpoint.AbstractTransactionSynchronizingPollingEndpoint.doPoll(AbstractTransactionSynchronizingPollingEndpoint.java:82) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:144) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy15.call(Unknown Source) at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:236) at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52) at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:48) at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49) at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:231) at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53) at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
Thanks in advance.


Reply With Quote
