2017-02-22 8 views
2

Я написал код для чтения сообщения IBM MQ с использованием Spring Integration JMS-message-driven-channel-adapter, но не смог прочитать сообщение из очереди, может кто-нибудь помочь мне ниже - моя конфигурация.Spring Integration jmsmessage-driven-channel-adapter с IBM MQ

<beans:bean id="ibmJmsConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory"> 
    <beans:property name="transportType" value="1"/> 
    <beans:property name="queueManager" value="***"/> 
    <beans:property name="hostName" value="**"/> 
    <beans:property name="port" value="**" /> 
    <beans:property name="channel" value="***"/> 
</beans:bean> 


<beans:bean id="receiverQueue" class="com.ibm.mq.jms.MQQueue"> 
    <beans:constructor-arg index="0" value="****"/> 
    <beans:constructor-arg index="1" value="****"/> 
</beans:bean> 
<integration:channel id="componentInfoChannel" /> 

<jms:message-driven-channel-adapter 
     id="componentInfoAdapter" connection-factory="ibmJmsConnectionFactory" destination="receiverQueue" channel="componentInfoChannel" 
     /> 

<integration:service-activator id="componentInfoActivator" 
     input-channel="componentInfoChannel" ref="componentInfoConsumer" 
     method="componentInfoListen" /> 

Выше конфигурации работает, но не суметь, когда я добавил вход адаптера его бесступенчатой ​​предупреждение печати на консоли .Detail которые упоминают ниже.

<integration:logging-channel-adapter 
     id="componentInfologger" level="INFO" /> 
    <integration:wire-tap id="componentInfoWireTap" 
     channel="componentInfologger" pattern="*" order="2" /> 
    <integration:logging-channel-adapter 
     id="logger" log-full-message="true" level="INFO" /> 

    2017-02-23 00:09:05.093 WARN [componentdatafiles,48f69e84ab395754,ebf4ae7f3b812a01,false] 90072 --- [ter.container-1] o.s.j.l.DefaultMessageListenerContainer : Execution of JMS message listener failed, and no ErrorHandler has been set. 
java.lang.StackOverflowError: null 
    at java.util.Collections$SynchronizedMap.put(Unknown Source) 
    at ch.qos.logback.classic.util.LogbackMDCAdapter.put(LogbackMDCAdapter.java:110) 
    at org.slf4j.MDC.put(MDC.java:147) 
    at org.springframework.cloud.sleuth.log.Slf4jSpanLogger.logStartedSpan(Slf4jSpanLogger.java:48) 
    at org.springframework.cloud.sleuth.trace.DefaultTracer.createChild(DefaultTracer.java:170) 
    at org.springframework.cloud.sleuth.trace.DefaultTracer.createSpan(DefaultTracer.java:72) 
    at org.springframework.cloud.sleuth.instrument.messaging.TraceChannelInterceptor.startSpan(TraceChannelInterceptor.java:98) 
    at org.springframework.cloud.sleuth.instrument.messaging.TraceChannelInterceptor.preSend(TraceChannelInterceptor.java:78) 
    at org.springframework.integration.channel.AbstractMessageChannel$ChannelInterceptorList.preSend(AbstractMessageChannel.java:538) 
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:415) 
    at org.springframework.integration.channel.interceptor.WireTap.preSend(WireTap.java:168) 
    at org.springframework.integration.channel.AbstractMessageChannel$ChannelInterceptorList.preSend(AbstractMessageChannel.java:538) 
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:415) 
    at org.springframework.integration.channel.interceptor.WireTap.preSend(WireTap.java:168) 
    at org.springframework.integration.channel.AbstractMessageChannel$ChannelInterceptorList.preSend(AbstractMessageChannel.java:538) 
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:415) 
    at org.springframework.integration.channel.interceptor.WireTap.preSend(WireTap.java:168) 
    at org.springframework.integration.channel.AbstractMessageChannel$ChannelInterceptorList.preSend(AbstractMessageChannel.java:538) 
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:415) 
    at org.springframework.integration.channel.interceptor.WireTap.preSend(WireTap.java:168) 
+1

Не могли бы вы подробнее остановиться? Что такое симптомы? Как выглядит проблема? В вашем конфиге ничего нет. Некоторые журналы, StackTraces, тестовые файлы и т. Д., Пожалуйста. –

+0

Отредактированный мой вопрос, пожалуйста, изучите его –

ответ

1

Извините за задержку. Итак, я думаю, ваш id="logger" является избыточным компонентом. И проблема в точности с <integration:wire-tap> и комбинацией с TraceChannelInterceptor.

Я имею в виду, что вы используете здесь Spring Cloud Sleuth.

Не могли бы вы поделиться DEBUG для категории org.springframework.integration, тем временем я пытаюсь воспроизвести проблему локально.

Плюс вы можете исключить componentInfologger из трассировки, чтобы избежать этого java.lang.StackOverflowError.

Я думаю, что это происходит как-то, что мы отслеживаем петлю через wire-tap.

+0

No-op. Вам нужно простое приложение Spring Boot от вас, чтобы играть. Думаю, это уже без JMS. Похоже, у вас есть рекурсия как-то в вашей конфигурации ... –

+0

Спасибо Артем получил эту проблему, ее из-за дублирования регистратора id, а объект Logger создан из LoggerFactory в двух разных классах с тем же именем класса ComponentInfoConsumer.class. закрытие вопроса –

Смежные вопросы