0
votes

How do i handle the exception from the method which we use inside .handle? In the code snippet below, processMessage method throws Exception (public void processMessage(Message message) throws Exception ) in the declaration and am not sure how to handle it in dsl in case of chaining? In case of XML, its easy as XML doesnt check for exception where as IDE doesnt let you compile in case of DSL. Can you please advise as the below code snippet is showing exception?

  return IntegrationFlows
            .from("channel1")
            .handle(Message.class, (payload, header) -> processer.processMessage(payload))
            .get();
1

1 Answers

0
votes

??? If you say IDE doesn't allow to compile, the it isn't exception . That is compilation error - different story. Spring Integration Java DSL is just Java. So, if you code the method call, you should follow its signature, otherwise what is the point of using typed language at all?