cesarjv opened a new issue, #5907:
URL: https://github.com/apache/camel-quarkus/issues/5907

   I am currently working on a service using Apache Camel and Quarkus, in which 
I must call 2 SOAP Webservices, one that allows me to obtain a session id 
(called LGI Command) and the next allows me to consult the information from a 
mobile number. associated with it (Called LST_DYNSUB Command), passing the 
session id previously obtained with the LGI Command. The question is that these 
2 calls must be made through the same port due to the policies of the 
application to be called where the aforementioned SOAP interfaces are located, 
called UDB, the UDB only admits a valid session id in the LST_DYNSUB command if 
the same port through which the LGI Command.
   
   Testing in Postman does not give me problems and it can be seen that when 
testing both SOAP interfaces there are no problems, however, when I come to 
develop my waterfall logic in my Apache Camel and Quarkus development, it can 
be observed at the destination log level (UDB) that is being sent through 
different ports.
   
   Called in postman and where it is observed that both interfaces arrive 
through the same ports:
   
   ![Sin 
título](https://github.com/apache/camel-quarkus/assets/31625237/448d9f2e-87f9-4bbd-abb6-7ba43a604053)
   
   Called from my microservice with Apache Camel and Quarkus where it is 
evident that it is arriving through a different port, even though it is within 
the same logic:
   
   ![Sin 
título](https://github.com/apache/camel-quarkus/assets/31625237/284b4c26-4b37-480a-83b9-be2ad7703f38)
   
   I attach the logic of my Red Route in Apache Camel:
   
   **Class Rest Route**
   
   ```
   @ApplicationScoped
   public class RestRoute extends RouteBuilder {
   
       private static final String SALIDA_MS = "Salida del MS 
${exchangeProperty[bodyRs]}";
       private static final String MSG_EXCEPTION = "Descripcion de la 
Exception: ${exception.message}";
   
       private static final String DATE_LOG = 
"[${bean:BeanDate.getCurrentDateTime()}] ";
       @ConfigProperty(name = "client.url.udb")
       String urlUDB;
   
       @ConfigProperty(name = "path.openapi")
       String pathOpenapi;
   
       @ConfigProperty(name = "descripcion.servicio")
       String descriptionService;
   
       private ConfigureSsl configureSsl;
   
       private IGetCurrentDateTime getCurrentDateTime;
   
       public RestRoute() {
           getCurrentDateTime = new GetCurrentDateTime();
           TimeZone.setDefault(TimeZone.getTimeZone("GMT-4"));
           configureSsl = new ConfigureSsl();
       }
       @Override
       public void configure() throws Exception {
   
           BeanDate beanDate= new BeanDate();
           getContext().getRegistry().bind("BeanDate", beanDate);
   
           
restConfiguration().bindingMode(RestBindingMode.json).dataFormatProperty("json.in.disableFeatures","FAIL_ON_UNKNOWN_PROPERTIES")
                   .apiContextPath(pathOpenapi)
                   .apiProperty("api.title","UdbLoginConnector")
                   .apiProperty("api.description",descriptionService)
                   .apiProperty("api-version","1.0.0")
                   .apiProperty("cors","true");
           rest("/api/")
                   .produces("application/json")
                   .consumes("application/json")
                   .post("/deviceStatusConnector")
                   .type(Request.class)
                   
.param().name("Request").type(RestParamType.body).description("Parametros de 
Entradas")
                   .required(true)
                   .endParam()
                   .outType(Response.class)
                   
.param().name("Response").type(RestParamType.body).description("Parametros de 
Salidas")
                   .required(true)
                   .endParam().to("direct:pipeline");
   
                   from("direct:pipeline")
                           .doTry()
                               /*.to("bean-validator:validateRequest") */
                               .process(new DeviceStatusConnectorProcessorReq())
                               .log(DATE_LOG+"Datos de Entrada del MS: 
${exchangeProperty[bodyRq]}")
                               .process(new UdbLgiCommandProcessorReq())
                               .log(DATE_LOG+"Datos de Entrada del WebService 
(SOAP) Comando-LGI UDB: ${exchangeProperty[wsRq]}")
                               
.to(configureSsl.setupSSLContext(getCamelContext(), urlUDB))
                               .log(DATE_LOG+"Datos de Salida del el WebService 
(SOAP) Comando-LGI UDB: ${body}")
                               .process( new UdbLgiCommandProcessRes())
                               .log(DATE_LOG+"SessionId Obtenido Comando-LGI 
UDB: ${exchangeProperty[sessionId]}")
                               .log(DATE_LOG+"Codigo de Respuesta Comando-LGI 
UDB: ${exchangeProperty[resultCodeLgiCommand]}")
                               .log(DATE_LOG+"Descripcion de Respuesta 
Comando-LGI UDB: ${exchangeProperty[resultDescriptionLgiCommand]}")
                               .process(new UdbLstDynsubCommandProcessorReq())
                                .log(DATE_LOG+"Datos de Entrada del WebService 
(SOAP) Comando LST-DYNSUB: ${exchangeProperty[wsRq]}")
                               .log(DATE_LOG+"Header de Entrada del WebService 
(SOAP) Comando LST-DYNSUB: ${headers}")
                               
.to(configureSsl.setupSSLContext(getCamelContext(), urlUDB))
                               .log(DATE_LOG+"Datos de Salida del WebService 
(SOAP) Comando LST-DYNSUB: ${body}")
                           .endDoTry();
       }
   }
   ```
   **UdbLgiCommandProcessorReq**
   
   ```
   @Slf4j
   @ApplicationScoped
   public class UdbLgiCommandProcessorReq implements Processor{
   
        private final String usernameUdbLgiCommand = 
ConfigProvider.getConfig().getValue("username.udb.lgi.command", String.class);
        private final String passwordUdbLgiCommand = 
ConfigProvider.getConfig().getValue("password.udb.lgi.command", String.class);
   
        private final IUdbLgiCommandRequestMapping requestMapping;
   
        public UdbLgiCommandProcessorReq() {
                requestMapping = new UdbLgiCommandRequestMappingImpl();
        }
        
        @SuppressWarnings({ "deprecation", "unchecked", "rawtypes" })
        @Override
        public void process(Exchange exchange) throws Exception {
   
                /*log.info("Request Json Entrada: 
"+udbLoginConnectorJsonReq.toString()); */
                EnvelopeRqLgiCommand envelopeRqLgiCommand = 
requestMapping.toRequest(usernameUdbLgiCommand, passwordUdbLgiCommand);
                String xmlWsRq = new 
GenericXml().toXmlString(envelopeRqLgiCommand);
                /*log.info("Transformation to XML "+xmlWsRq); */
                exchange.setProperty("wsRq", xmlWsRq.replaceAll("[\n\t\r]", 
""));
                exchange.getOut().setHeader(Exchange.CONTENT_TYPE, 
"application/xml");
                exchange.getOut().setHeader(Exchange.HTTP_METHOD, "POST");
                exchange.getOut().setBody(xmlWsRq);
        }
   }
   ```
   
   **UdbLstDynsubCommandProcessorReq**
   
   ```
   @Slf4j
   @ApplicationScoped
   public class UdbLstDynsubCommandProcessorReq implements Processor{
   
   
        private final IUdbLstDynsubCommandRequestMapping requestMapping;
   
        public UdbLstDynsubCommandProcessorReq() {
                requestMapping = new UdbLstDynsubCommandRequestMappingImpl();
        }
        
        @SuppressWarnings({ "deprecation", "unchecked", "rawtypes" })
        @Override
        public void process(Exchange exchange) throws Exception {
   
                /*log.info("Request Json Entrada: 
"+udbLoginConnectorJsonReq.toString()); */
                String sessionId=exchange.getProperty("sessionId", 
String.class);
                Request request =  
exchange.getProperty("deviceStatusConnectorRq", Request.class);
                EnvelopeRqLstDynSubCommand envelopeRqLstDynSubCommand = 
requestMapping.toRequest(request.getUdbDeviceStatusConnectorRequest().getBodyRequest().getIsdn(),
 request.getUdbDeviceStatusConnectorRequest().getBodyRequest().getContent());
                String xmlWsRq = new 
GenericXml().toXmlString(envelopeRqLstDynSubCommand);
                /*log.info("Transformation to XML "+xmlWsRq); */
                exchange.setProperty("wsRq", xmlWsRq.replaceAll("[\n\t\r]", 
""));
                exchange.getOut().setHeader(Exchange.CONTENT_TYPE, 
"application/xml");
                exchange.getOut().setHeader(Exchange.HTTP_METHOD, "POST");
                exchange.getOut().setHeader(Exchange.HTTP_PATH, sessionId);
                exchange.getOut().setBody(xmlWsRq);
        }
   }
   ```
   
   Does this have any logical explanation as to why it could be happening in 
Apache Camel and Quarkus?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to