Después de la invocación del canal de error, se cambia ip_connection_id

I configured to handle error and response error message even if the error happens. So, I set error-channel in inbound-adaptor.

And I catched failed message's header info using Message.

    MessageTransformationException exBody = (MessageTransformationException) message.getPayload();
    message = exBody.getFailedMessage();

But the problem is ip_connection_id changed like below.

ip_connection_id=127.0.0.1:51049:dd62fed7-00d2-4a7e-8f99-908b4766b862

ip_connection_id=127.0.0.1:51051:d09d5273-a0e9-4ab9-ac73-f1963febf997

Please let me know how to make ip_connection_id immutable. I have to synchronous response to caller. Thanks.

preguntado el 04 de julio de 12 a las 08:07

1 Respuestas

There must be something else happening; the ip_connection_id is immutable, in that it will always reflect the id of the connection the message is received on, which is set up in the constructor of the connection and never changed. If you have a message with a different connection id, it came from a different connection.

I just modified the sample here https://github.com/SpringSource/spring-integration-samples/tree/master/basic/tcp-client-server to add the connection id to the error message...

    <int:transformer id="errorHandler"
    input-channel="errorChannel"
    expression="payload.failedMessage.payload + ':' + payload.cause.message + ':' + payload.failedMessage.headers.ip_connection_id"/>

and everything worked as expected...

preSend on channel 'toSA' ... ip_connection_id=localhost:48161:ef1b59ce-1495-417f-93d3-e38e935922f3

...

preSend on channel 'errorChannel'...

...

TcpNetConnection - TcpNetConnection - Message sent [Payload=FAIL:Failure Demonstration:localhost:48161:ef1b59ce-1495-417f-93d3-e38e935922f3

I suggest you run with DEBUG logging and follow the messages through your flows.

Respondido 04 Jul 12, 13:07

Thanks, it was my mistake. Like you said, other connection invoked that. - muy fuertejoe

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.