Spring集成:MQSeries消息驱动的适配器不工作

时间:2017-07-18 17:41:51

标签: spring spring-integration message-queue ibm-mq spring-jms

我能够成功整合ActiveMQ(绑定消息驱动通道)和Kafka(作为出站通道)。它工作正常。

现在,既然ActiveMQ和MQ系列都符合JMS标准,我认为转换会更容易。但是,它抛出以下错误:

setTick(vm.property, vm.propertyList);

我的spring集成配置如下所示:

Setup of JMS Message listener invoker failed for destination 'queue://abcd' - trying to recover - Cause: JMSQ1112: The operation for a domain specific object was not valid. The operation 'createConsumer' is not valid for type 'com.ibm.mq.jms.MQQueue'

我的代码如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:jms="http://www.springframework.org/schema/integration/jms"
    xmlns:integration="http://www.springframework.org/schema/integration"
    xmlns:int-kafka="http://www.springframework.org/schema/integration/kafka"
    xmlns:task="http://www.springframework.org/schema/task"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans.xsd 
    http://www.springframework.org/schema/integration/jms 
    http://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd
    http://www.springframework.org/schema/integration/kafka 
    http://www.springframework.org/schema/integration/kafka/spring-integration-kafka.xsd">

    <jms:message-driven-channel-adapter id="requestChannelAdapter" channel="requestChannel" 
    container="requestListenerContainer" error-channel=""/>


    <int-kafka:outbound-channel-adapter
        id="kafkaOutboundChannelAdapter" kafka-template="kafkaTemplate"
        auto-startup="true" sync="true" channel="inputToKafka" topic="test">
    </int-kafka:outbound-channel-adapter>
</beans>

为什么我收到此错误?我看到了一些帖子,这是因为jmsTemplate w.r.t MQQueue中没有pubLocal值,但这可以追溯到2005年,我注意到更改已经发布。

1 个答案:

答案 0 :(得分:1)

仅使用container.setDestinationName(HELLO_QUEUE),让容器通过Session正确解析。