I have established SI channels that send HTTP requests from a client to SI to a REST service and back through SI to the client. I would like the contents of the request to get sent off elsewhere to a service activator to do some unrelated auditing stuff. However, even though there are no exceptions and the logs look promising, I am not seeing any evidence of the service activator doing anything.
Here is my configuration of the channels and endpoints:
Code:
<channel id="requestChannel">
<interceptors>
<wire-tap channel="auditChannel" />
</interceptors>
</channel>
...
<channel id="auditChannel">
<dispatcher task-executor="auditExecutor"/>
</channel>
...
<service-activator input-channel="auditChannel" ref="auditor" method="audit"/>
Here is the activator:
Code:
@MessageEndpoint
public class Auditor {
@ServiceActivator
public void audit(@Payload String payload,
@Header("header1") String header1,
@Header("header2") String header2) throws Exception {
//Stuff
}
Finally, the logs:
Code:
18:40:31 DEBUG [o.s.i.c.ExecutorChannel.preSend] preSend on channel 'auditChannel', message: [Payload=[B@2ee73750][Headers={timestamp=1305744031561, id=4f2a6136-a82c-4d30-9a41-ea0c9781c620, errorChannel=org.springframework.integration.core.MessagingTemplate$TemporaryReplyChannel@4de07d3e, content-type=application/json;charset=UTF-8, http_requestMethod=POST, replyChannel=org.springframework.integration.core.MessagingTemplate$TemporaryReplyChannel@4de07d3e, accept=application/json, http_requestUrl=http://localhost:8080/myapp/documents/search}]
18:40:31 DEBUG [o.s.i.c.ExecutorChannel.postSend] postSend (sent=true) on channel 'auditChannel', message: [Payload=[B@2ee73750][Headers={timestamp=1305744031561, id=4f2a6136-a82c-4d30-9a41-ea0c9781c620, errorChannel=org.springframework.integration.core.MessagingTemplate$TemporaryReplyChannel@4de07d3e, content-type=application/json;charset=UTF-8, http_requestMethod=POST, replyChannel=org.springframework.integration.core.MessagingTemplate$TemporaryReplyChannel@4de07d3e, accept=application/json, http_requestUrl=http://localhost:8080/myapp/documents/search}]
18:40:31 DEBUG [o.s.i.h.ServiceActivatingHandler.handleMessage] ServiceActivator for [org.springframework.integration.handler.MethodInvokingMessageProcessor@24c1f7dc] received message: [Payload=[B@2ee73750][Headers={timestamp=1305744031561, id=4f2a6136-a82c-4d30-9a41-ea0c9781c620, errorChannel=org.springframework.integration.core.MessagingTemplate$TemporaryReplyChannel@4de07d3e, content-type=application/json;charset=UTF-8, http_requestMethod=POST, replyChannel=org.springframework.integration.core.MessagingTemplate$TemporaryReplyChannel@4de07d3e, accept=application/json, http_requestUrl=http://localhost:8080/myapp/documents/search}]
There are two problems
- The service activator isn't getting the message.
- The custom headers "header1" and "header2," which are included as HTTP headers in the inbound request, aren't showing up in the logs of the messages.
Any insight into where I have miscoded or misconfigured is appreciated.
Thanks.