我使用簡(jiǎn)單的代碼來(lái)處理來(lái)自 Google PubSub 訂閱的消息并將結(jié)果返回到主題中。但出于某種原因,添加到輸入消息的所有標(biāo)頭也會(huì)出現(xiàn)在輸出消息標(biāo)頭中。有沒(méi)有辦法擺脫這種行為?處理代碼如下所示:@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"));}我沒(méi)有在 Spring Integration 文檔中找到任何關(guān)于從輸入到輸出的“克隆”的提及。
如何避免在 Spring Integration @ServiceActivator 方法中將標(biāo)頭
ibeautiful
2023-06-04 17:33:48