我使用簡單的代碼來處理來自 Google PubSub 訂閱的消息并將結果返回到主題中。但出于某種原因,添加到輸入消息的所有標頭也會出現在輸出消息標頭中。有沒有辦法擺脫這種行為?處理代碼如下所示:@ServiceActivator(inputChannel = "myInput", outputChannel = "myOutput")public Message<String> onMessage(String payload, @Headers Map<String,Object> headers) throws SocketTimeoutException {... return new GenericMessage<>(responseJson, Collections.singletonMap("type", "something"));}我沒有在 Spring Integration 文檔中找到任何關于從輸入到輸出的“克隆”的提及。
如何避免在 Spring Integration @ServiceActivator 方法中將標頭
ibeautiful
2023-06-04 17:33:48