Spring Gemfire 存储负载的集成出站通道

Spring integration outbound channel for Gemfire to store payload

我正在尝试将 payload 发送到 gemfire 缓存。我收到此 payload 作为 MQ 消息。如果我的 outbound adapter 是另一个 Queue.

,它工作正常

但是,当出站通道是 Gemfire 的出站适配器时,它会抛出异常。下面是代码片段。

非常感谢您的帮助。因为我是 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>

以下是我在应用程序中收到消息时看到的错误

[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"?

payload 打印在上一行..下一行是错误

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)

首先,堆栈跟踪中的信息不足。 CacheWritingMessageHandler.

没有分数

从另一边看:http://docs.spring.io/spring-integration/docs/latest-ga/reference/html/gemfire.html#gemfire-outbound。因此,您的 <entry key="payload" value="abcd"/> 无效,因为 keyvalue 都必须是 SpEL 表达式。由于根评估对象是 Message Message 对象上没有这样的 getter getAbcd()

AbstractMethodError 通常是因为类路径问题(版本不匹配)。

在这种情况下,您似乎正在使用 spring-integration-core 4.x 和 spring-integration-gemfire 3.x(或更早版本);反之亦然。

在 4.0 中,该方法的签名发生了变化(不同的 Message 对象)。

我建议您对所有内容使用 4.1.2。