BewareMyPower commented on issue #12087:
URL: https://github.com/apache/pulsar/issues/12087#issuecomment-922405741


   @eolivelli `ConsumerBuilder` is a class in **pulsar-client-api** module that 
has no dependency. If **pulsar-common** was added as the dependency of 
**pulsar-client-api** because it will cause cyclic dependency.
   
   ```
   org.apache.pulsar:pulsar-common:jar:2.9.0-SNAPSHOT
   +- org.apache.pulsar:pulsar-client-api:jar:2.9.0-SNAPSHOT:compile
   ```
   
   Also we can't put `PayloadConverter` into **pulsar-client-api** package 
because we must import `BrokerEntryMetadata` and `MessageMetadata` from 
**pulsar-common** package.
   
   If we changed the `PayloadConverter` interface to
   
   ```java
   interface PayloadConverter {
       ByteBuf convert(ByteBuf headerAndPayload);
   }
   ```
   
   Maybe it could work, but we need to parse `BrokerEntryMetadata` and 
`MessageMetadata` repeatedly in all valid implementations. BTW, we need to 
import netty dependency for `ByteBuf`. I'm not sure if it's proper for 
**pulsar-client-api** package to do that.


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