Search code examples
spring-integrationgemfirespring-data-gemfire

Spring integration outbound channel for Gemfire to store payload


I am trying to send payload over to gemfire cache. I receive this payload as a MQ Message. It works fine if my outbound adapter is another Queue.

However when the outbound channel is outbound adapter for Gemfire it throws exception. Below is the code snippet.

Help here is really appreciated. As i am new to Gemfire + Spring IO

<jms:message-driven-channel-adapter id="wMQ_in_channelAdapter" 
       concurrent-consumers="5"
       max-concurrent-consumers="10"
       connection-factory="inCachingConnectionFactory"           
       destination="requestQueue-mq"
       extract-payload="true"
       channel="demoChannel"/>


<integration:channel id="demoChannel"/>

<integration:service-activator input-channel="demoChannel" 
            ref="demoBean"
            method="upperCase"
            output-channel="orchestrationChannel" /> 

<integration:channel id="orchestrationChannel"/>

<gfe:cache id="PushProducer" cache-xml-location="classpath:PushProducer.xml"/>

<gfe:lookup-region id="exampleRegion" cache-ref="PushProducer" name="exampleRegion"/> 

<int-gfe:outbound-channel-adapter id="cacheChannel" channel="orchestrationChannel" region="exampleRegion">
        <int-gfe:cache-entries>
            <entry key="payload" value="abcd"/>
        </int-gfe:cache-entries> 
</int-gfe:outbound-channel-adapter>

Below is the error i am seeing when the message is received in the application

[org.springframework.jms.listener.DefaultMessageListenerContainer#0-3][org.springframework.integration.gemfire.outbound.CacheWritingMessageHandler] org.springframework.integration.gemfire.outbound.CacheWritingMessageHandler#0 received message: GenericMessage [payload=<?xml version="1.0" encoding="UTF-8"?

The payload is printed here in above line.. and the below line is the error

12:20:00.196 WARN  [org.springframework.jms.listener.DefaultMessageListenerContainer#0-3][org.springframework.jms.listener.DefaultMessageListenerContainer] Execution of JMS message listener failed, and no ErrorHandler has been set.
java.lang.AbstractMethodError
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
    at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:101)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
    at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77)
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:277)
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:239)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45)
    at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:95)
    at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutput(AbstractMessageProducingHandler.java:248)
    at org.springframework.integration.handler.AbstractMessageProducingHandler.produceOutput(AbstractMessageProducingHandler.java:171)
    at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutputs(AbstractMessageProducingHandler.java:119)
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:105)
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
    at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:101)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
    at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77)
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:277)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45)
    at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:95)
    at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:133)
    at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:125)
    at org.springframework.integration.gateway.MessagingGatewaySupport.send(MessagingGatewaySupport.java:302)
    at org.springframework.integration.jms.ChannelPublishingJmsMessageListener$GatewayDelegate.send(ChannelPublishingJmsMessageListener.java:479)
    at org.springframework.integration.jms.ChannelPublishingJmsMessageListener.onMessage(ChannelPublishingJmsMessageListener.java:322)
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:660)
    at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:620)
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:591)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:308)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:246)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1142)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1134)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1031)
    at java.lang.Thread.run(Thread.java:662)

Solution

  • AbstractMethodError is usually because of a classpath problem (version mismatch).

    In this case, it looks like you are using spring-integration-core 4.x and spring-integration-gemfire 3.x (or earlier); or vice-versa.

    In 4.0, the signature of that method changed (different Message object).

    I suggest you use 4.1.2 for everything.