bvahdat commented on PR #19110:
URL: https://github.com/apache/camel/pull/19110#issuecomment-3290848940

   > > Hi @ppalaga
   > > As `SimpleDateFormat` is not thread-safe, would we then run into 
problems where `RestOpenApiSupport#getJsonFromOpenAPIAsString` API is used 
concurrently through multiple threads? I think safer would be to instantiate it 
per request / call.
   > 
   > I agree, `SimpleDateFormat` is not thread-safe, but I have no idea whether 
`RestOpenApiSupport#getJsonFromOpenAPIAsString` can be called concurrently. It 
would be great if some subject matter could check.
   
   I meant, what would happen if multiple rest clients simultaneously call the 
exposed rest endpoint by https://github.com/apache/camel-quarkus/issues/7717 ? 
Do we maybe run into unexpected results again as originally reported by the 
issue above?
   
   ```
   [ERROR]   OpenApiV3Test.arrayTypes:368 1 expectation failed.
   JSON path 
paths.'/api/operation/spec/array/params'.get.parameters[9].schema.enum doesn't 
match.
   Expected: iterable containing ["2023-01-01", "2023-02-02", "2023-03-03"]
     Actual: <[2022-12-31, 2023-02-01, 2023-03-02]>
   
   [ERROR]   OpenApiV3Test.arrayTypes:368 1 expectation failed.
   JSON path 
paths.'/api/operation/spec/array/params'.get.parameters[9].schema.enum doesn't 
match.
   Expected: iterable containing ["2023-01-01", "2023-02-02", "2023-03-03"]
     Actual: <[2022-12-31, 2023-02-01, 2023-03-02]>
   ``` 
   
   As because the same `SimpleDateFormat` object is now reused across multiple 
HTTP caller threads through this fix. 


-- 
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