Actuellement, nous utilisons Spring Integration 2.1.0 Release dans notre application. flux d'application est comme ci-dessous:Recevoir l'accusé de réception du serveur TCP à notre application en utilisant le printemps Intégration
- Certaines opération est réalisée en application et nous avons eu la chaîne de sortie dans la chaîne via Active MQ.
- J'ai utilisé l'adaptateur de canal piloté par message et l'activateur de service pour lire les données de la file d'attente.
- Ces données sont affichées avec succès sur le serveur (l'application fonctionne en tant que client) en utilisant tcp-outbound-gateway.
- Le problème est lors de l'obtention de l'accusé de réception du serveur.
- Création d'un nouveau canal et entrée dans le canal de réponse dans la passerelle tcp-outbound
- Passage du même canal dans l'activateur de service en tant que canal d'entrée.
Il montre ci-dessous erreur:
[task-scheduler-5] 2017-10-05 18:32:20,732 ERROR org.springframework.integration.handler.LoggingHandler - org.springframework.integration.MessageDeliveryException: Dispatcher has no subscribers. at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:108) at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:101) at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:61) at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157) at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:128) at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288) at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
est comme ci-dessous
<context:property-placeholder />
<!-- Gateway and connection factory setting -->
<int:channel id="telnetLandingChannel" />
<int:channel id="telnetReplyChannel" />
<beans:bean id="clientCustomSerializer"
class="com.telnet.core.serializer.CustomSerializer">
<beans:property name="terminatingChar" value="10" />
<beans:property name="maxLength" value="65535" />
</beans:bean>
<int:gateway id="gw" default-reply-channel="telnetReplyChannel" default-reply-timeout="100000"
service-interface="com.telnet.core.integration.connection.ParseTcpConfiguration$SimpleGateway"
default-request-channel="telnetLandingChannel"/>
<ip:tcp-connection-factory id="clientFactory"
type="client" host="localhost" port="7777" single-use="false" using-nio="false"
serializer="${client.serializer}" deserializer="${client.serializer}" />
<ip:tcp-outbound-gateway id="clientInGw"
request-channel="telnetLandingChannel"
connection-factory="clientFactory"
reply-channel="telnetReplyChannel"
reply-timeout="100000"/>
<!-- To send the messege over server via JMS and serviceActivator -->
<int:channel id="incidentDispatchMessageChannel" />
<int:channel id="jmsChannel" />
<beans:bean id="customClientServiceActivator"
class= "com.telnet.core.integration.CustomClientServiceActivator">
</beans:bean>
<int-jms:message-driven-channel-adapter id="incidentDispatchMessageChannelAdapter" error-channel="errorChannel"
connection-factory="mqConnectionFactory"
destination-name="${incident.processing.messaging.dispatch.queues}"
channel="incidentDispatchMessageChannel"/>
<int:service-activator id="incidentMessageActivator"
input-channel="incidentDispatchMessageChannel"
output-channel="jmsChannel"
ref="customClientServiceActivator" method="getOutboundMessage">
</int:service-activator>
<int:object-to-string-transformer id="clientBytes2String"
input-channel="jmsChannel"
output-channel="telnetLandingChannel"/>
<!-- To receive the acknowledgement message on server via serviceActivator -->
<int:service-activator id="incidentAck"
input-channel="telnetReplyChannel"
ref="customClientServiceActivator" method="getAck">
</int:service-activator>
J'ai étudié divers article sur stackverFlow mais pas en mesure d'obtenir une solution
J'ai supprimé telnetReplyChannel du canal de réponse par défaut (de passerelle) et du canal de réponse (de). –
Je suis capable de voir le message d'accusé de réception (comme byteArray) dans la charge utile dans AbstractReplyProducingMessageHandler.sendReplyMessage (Message > replyMessage, final Object replyChannelHeaderValue) mais replyChannelHeaderValue est null. S'il vous plaît aider .. –
S'il vous plaît, partagez votre code via un EDIT dans votre question –