1
我正在使用Spring AMQP和Spring Integration。我目前正在使用集成服務激活器作爲我的處理程序。我試圖讓amqp監聽器工作,但我從來沒有收到消息。正在使用服務激活者接受的練習還是應該使用聽衆?服務激活器或偵聽器容器
<!-- Receive Inbound messages and process them -->
<int-amqp:inbound-channel-adapter channel="sda.text.analytics.process.channel" queue-names="${sda.text.analytics.process.queue}"
connection-factory="sda.text.analytics.connectionFactory" prefetch-count="${sda.mule.prefetchCount}"
concurrent-consumers="${uima.process.threads}" task-executor="analyticsExecutor" receive-timeout="5000"/>
<int:json-to-object-transformer input-channel="sda.text.analytics.process.channel" type="com.issinc.sda.ingest.impl.IngestBean"/>
<bean id="analyticsExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="${uima.process.threads}" />
<property name="maxPoolSize" value="${uima.process.threads}" />
<property name="queueCapacity" value="${sda.mule.prefetchCount}" />
</bean>
<!-- Service that listens for an inbound messages, processes the text and sends the processed text back -->
<int:service-activator input-channel="sda.text.analytics.process.channel" output-channel="sda.text.analytics.response.channel"
ref="asyncExtractionService" method="processMessage" >
</int:service-activator>
<!--<rabbit:listener-container connection-factory="sda.connectionFactory" message-converter="jsonMessageConverter">
<rabbit:listener ref="asyncExtractionService" method="processMessage" queue-names="${sda.process.queue}" />
</rabbit:listener-container>-->
謝謝加里。我有一個通道適配器: –
dbmargo
正如您所見, code/config在這裏的註釋中不能很好地呈現。最好編輯你的問題。你隊列中有消息嗎?你的房產是否正確?通常,打開調試日誌記錄將提供足夠的信息來調試像這樣的問題。 –
你還應該看看[示例](https://github.com/spring-projects/spring-integration-samples/tree/master/basic/amqp)。 –