Re: Reset exchange properties modifications when i call unmarshall in my route
Hi Joël, You sent your message to the wrong mailing list. I guess you meant us...@camel.apache.org Martin On Mon, Sep 26, 2022 at 4:24 PM Joël Guelluy wrote: > Hello, > There is something i don't understand around conversion and loosing > modifications on my exchange (Camel 2.25.4) > > NOTE : At the end of this mail, i put a simplified version of my code > and the traces. > > My route basically does this : > 1) from email with copyTo=outFolder&delete=true > 2) process(myProcessor) : Inside this, i do some work, including some > modifications, eventually an override of copyTo, and finish with a call > of a RestWS (return (String)response). > 3) .unmarshal(new JacksonDataFormat(Reply.class)) > 4) remaining steps (not important) > > All the process is OK except 1 thing : in the traces, i see the > modifications on the exchange before the unmarshal, and the original > values are back after the unmarshall. > > I want to keep the modified properties in the following steps of my > route. > Do you know how i can to it ? > > Joël > > > --- > > > from(imap://server?username=xxx&password=xxx©To=ACC/out&delete=true&unseen=false&folderName=ACC/in&mapMailMessage=false) > .routeId("mail-Reply") > .process(myProcessor) > .unmarshal(new JacksonDataFormat(Reply.class)) > .choice() > .when(simple("${body.status} != 'OK'")) > .throwException(new MyException("Error")) > .end() > .transform(simple("${body.file.content}")) > .unmarshal().base64() > ... > > > public class MyProcessor implements Processor { > @Override > public void process(Exchange exchange) { > IMAPMessage mainMessage = > exchange.getIn().getBody(IMAPMessage.class); > String htmlCode = extractHTML(mainMessage.getContent()); > Map extractedData = extractData(htmlCode); > exchange.getIn().setHeader("copyTo", > "ACC/toCheck"); > exchange.getIn().setHeader("subject", "body"); > exchange.getProperties().putAll(extractedData); > > String subject = (String) > exchange.getIn().getHeader("subject"); > String jsResponse = callOfA_REST_WebService() > > exchange.getIn().setBody(jsResponse); > } > } > > logs > You can see subject and copyTo in the 1st line, they disapears in the > next line. > > 12:17:21.768 [Camel (camel-1) thread #3 - imap://mail.nuvem.intra] INFO > org.apache.camel.processor.interceptor.Tracer - > ID-PCP48141-1664187007789-0-6 >>> (mail-Reply) Processor@0x432f2970 --> > unmarshal[org.apache.camel.component.jackson.JacksonDataFormat@207dd1b7] > <<< Pattern:InOnly, Headers:{Accept-Language=en-US, en-AU, > breadcrumbId=ID-PCP48141-1664187007789-0-6, Content-Language=en-US, > Content-Type=multipart/alternative; > boundary="...", copyTo=ACC/toCheck, Date=Fri, 26 Aug 2022 09:51:32 > +0200, From="no-re...@xxx.be" , Message-ID=<6be3>, > MIME-Version=1.0, Received=[...], Subject=body, > Thread-Index=AdjRh0ZWl+D/M9njSGaY14JVfSU0xA==, Thread-Topic=mail > 25/08/2022 14:05:03 > , To="y...@yyy.be" , BodyType:String, > Body:{"id":"Corresp_Rest:064c","status":"OK","taskStatus":null,"messages":[""],"data":{"request_id":"Corresp_Rest:2","file":{"content":"JVBER... > > [Body clipped after 1000 chars, total length is 109290] > > 12:17:21.786 [Camel (camel-1) thread #3 - imap://mail.nuvem.intra] INFO > org.apache.camel.processor.interceptor.Tracer - > ID-PCP48141-1664187007789-0-6 >>> (mail-Reply) > unmarshal[org.apache.camel.component.jackson.JacksonDataFormat@207dd1b7] > --> choice <<< Pattern:InOnly, Headers:{Accept-Language=en-US, en-AU, > Content-Language=en-US, Content-Type=multipart/alternative; > boundary="...", Date=Fri, 26 Aug 2022 09:51:32 +0200, > From="no-re...@xxx.be" , Message-ID=<6be3>, > MIME-Version=1.0, Received=[... > ...], Subject=mail 25/08/2022 14:05:03, > Thread-Index=AdjRh0ZWl+D/M9njSGaY14JVfSU0xA==, Thread-Topic=mail > 25/08/2022 14:05:03 > , To="y...@yyy.be" , BodyType:be.myws.Reply, > Body:be.myws.Reply@6e6f51d7 > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Reset exchange properties modifications when i call unmarshall in my route
Hello, There is something i don't understand around conversion and loosing modifications on my exchange (Camel 2.25.4) NOTE : At the end of this mail, i put a simplified version of my code and the traces. My route basically does this : 1) from email with copyTo=outFolder&delete=true 2) process(myProcessor) : Inside this, i do some work, including some modifications, eventually an override of copyTo, and finish with a call of a RestWS (return (String)response). 3) .unmarshal(new JacksonDataFormat(Reply.class)) 4) remaining steps (not important) All the process is OK except 1 thing : in the traces, i see the modifications on the exchange before the unmarshal, and the original values are back after the unmarshall. I want to keep the modified properties in the following steps of my route. Do you know how i can to it ? Joël --- from(imap://server?username=xxx&password=xxx©To=ACC/out&delete=true&unseen=false&folderName=ACC/in&mapMailMessage=false) .routeId("mail-Reply") .process(myProcessor) .unmarshal(new JacksonDataFormat(Reply.class)) .choice() .when(simple("${body.status} != 'OK'")) .throwException(new MyException("Error")) .end() .transform(simple("${body.file.content}")) .unmarshal().base64() ... public class MyProcessor implements Processor { @Override public void process(Exchange exchange) { IMAPMessage mainMessage = exchange.getIn().getBody(IMAPMessage.class); String htmlCode = extractHTML(mainMessage.getContent()); Map extractedData = extractData(htmlCode); exchange.getIn().setHeader("copyTo", "ACC/toCheck"); exchange.getIn().setHeader("subject", "body"); exchange.getProperties().putAll(extractedData); String subject = (String) exchange.getIn().getHeader("subject"); String jsResponse = callOfA_REST_WebService() exchange.getIn().setBody(jsResponse); } } logs You can see subject and copyTo in the 1st line, they disapears in the next line. 12:17:21.768 [Camel (camel-1) thread #3 - imap://mail.nuvem.intra] INFO org.apache.camel.processor.interceptor.Tracer - ID-PCP48141-1664187007789-0-6 >>> (mail-Reply) Processor@0x432f2970 --> unmarshal[org.apache.camel.component.jackson.JacksonDataFormat@207dd1b7] <<< Pattern:InOnly, Headers:{Accept-Language=en-US, en-AU, breadcrumbId=ID-PCP48141-1664187007789-0-6, Content-Language=en-US, Content-Type=multipart/alternative; boundary="...", copyTo=ACC/toCheck, Date=Fri, 26 Aug 2022 09:51:32 +0200, From="no-re...@xxx.be" , Message-ID=<6be3>, MIME-Version=1.0, Received=[...], Subject=body, Thread-Index=AdjRh0ZWl+D/M9njSGaY14JVfSU0xA==, Thread-Topic=mail 25/08/2022 14:05:03 , To="y...@yyy.be" , BodyType:String, Body:{"id":"Corresp_Rest:064c","status":"OK","taskStatus":null,"messages":[""],"data":{"request_id":"Corresp_Rest:2","file":{"content":"JVBER... [Body clipped after 1000 chars, total length is 109290] 12:17:21.786 [Camel (camel-1) thread #3 - imap://mail.nuvem.intra] INFO org.apache.camel.processor.interceptor.Tracer - ID-PCP48141-1664187007789-0-6 >>> (mail-Reply) unmarshal[org.apache.camel.component.jackson.JacksonDataFormat@207dd1b7] --> choice <<< Pattern:InOnly, Headers:{Accept-Language=en-US, en-AU, Content-Language=en-US, Content-Type=multipart/alternative; boundary="...", Date=Fri, 26 Aug 2022 09:51:32 +0200, From="no-re...@xxx.be" , Message-ID=<6be3>, MIME-Version=1.0, Received=[... ...], Subject=mail 25/08/2022 14:05:03, Thread-Index=AdjRh0ZWl+D/M9njSGaY14JVfSU0xA==, Thread-Topic=mail 25/08/2022 14:05:03 , To="y...@yyy.be" , BodyType:be.myws.Reply, Body:be.myws.Reply@6e6f51d7 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Reg: Integrate Spring REST and OAuth2 in Wicket web Application
Hi! It should be quite straightforward once you start according to standard practices and best principles. You can find lots of resources via google, e.g., https://support.wicket.io/hc/en-us/articles/4411663172631-Getting-Started-with-SSO-OAuth2-SAML2- Or have you already tried it and do you have a more specific question? ** Martin ma 26. syysk. 2022 klo 9.40 sundar saba (sundarsabapa...@gmail.com) kirjoitti: > Hi all, > > I would like to use OAuth2 client credentials grant type > authentication in my Wicket project. Currently I am using spring security > in my project. But I already implement REST features from Wicketstuff REST > annotations for internal use. Now I want to create new REST endpoints for > Third party clients using Spring REST and secured by Spring OAuth2. Could > you all guide me in right direction >