Claus Ibsen created CAMEL-27811:
-----------------------------------

             Summary: camel-thrift: useGlobalSslContextParameters never 
applies, the consumer ignores exchangeProtocol, one client is shared by 
concurrent exchanges
                 Key: CAMEL-27811
                 URL: https://issues.apache.org/jira/browse/CAMEL-27811
             Project: Camel
          Issue Type: Bug
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-thrift for CAMEL-23832 
(pull request https://github.com/apache/camel/pull/31139).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. useGlobalSslContextParameters never applies
{{ThriftComponent.createEndpoint}} checks negotiationType and sslParameters on 
a fresh ThriftConfiguration, before {{setProperties(endpoint, parameters)}} 
applies the URI options, so negotiationType is still the default and the global 
SSLContextParameters are never used. The endpoint then fails to start for lack 
of sslParameters (it fails closed).
Proposed change: check after the options are set (for example in the endpoint 
doStart).

h4. 2. The consumer ignores exchangeProtocol
{{ThriftConsumer}} never sets a protocolFactory on the server Args, so the 
server always uses TBinaryProtocol. A producer with exchangeProtocol=JSON or 
COMPACT cannot talk to a Camel thrift consumer with the same option.
Proposed change: set the protocol factory from exchangeProtocol (SSL and ZLIB 
force binary today, which can stay).

h4. 3. One client is shared by concurrent exchanges
{{ThriftProducer}} keeps one client in a field. Concurrent exchanges use it at 
the same time: the async client throws IllegalStateException ("Client is 
currently executing another method"), and sync calls interleave on one socket.
Proposed change: use a client per call or a pool, or serialize the calls.

h4. 4. SJSON cannot read replies
TSimpleJSONProtocol is write-only, so every call with a reply fails when 
exchangeProtocol=SJSON.
Proposed change: reject SJSON for calls with replies, or remove it.


_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to