pjfanning opened a new pull request, #1526:
URL: https://github.com/apache/pekko-connectors/pull/1526

   Several `javadsl` classes exposed `scala.concurrent.Future` in their public 
API materialized value types, making them awkward to consume from Java. This PR 
replaces those with `java.util.concurrent.CompletionStage` equivalents and adds 
deprecated forwarders to preserve backward compatibility.
   
   ## Changes
   
   - **`couchbase3/.../javadsl/CouchbaseSink`** — All 8 sink factory methods 
now return `Sink[T, CompletionStage[Done]]` (or 
`CompletionStage[java.lang.Boolean]` for `exists`). Old signatures preserved as 
`@deprecated` methods with an `F` suffix (e.g. `insertDocF`, `upsertF`, 
`existsF`, …).
   
   - **`google-cloud-pub-sub/.../javadsl/GooglePubSub`** — `subscribeFlow` now 
returns `Flow[Done, ReceivedMessage, CompletionStage[NotUsed]]`. Old 
`Future`-returning variant kept as `@deprecated subscribeFlowWithScalaFuture`.
   
   - **`kinesis/.../javadsl/KinesisSchedulerSource`** — New `createShardedCs` 
returns `SubSource[CommittableRecord, CompletionStage[Scheduler]]`. Old 
`createSharded` (returning `Future[Scheduler]`) is now `@deprecated`.
   
   - **`kinesis/.../docs/javadsl/KclSnippets`** — Added `createShardedCs` usage 
example.
   
   ## Example (Couchbase)
   
   ```java
   // Before — materialized value was scala.concurrent.Future, not usable from 
Java
   Sink<MutationDocument<MyDoc>, Future<Done>> sink = 
CouchbaseSink.insertDoc(options);
   
   // After — proper Java API
   Sink<MutationDocument<MyDoc>, CompletionStage<Done>> sink = 
CouchbaseSink.insertDoc(options);
   
   // Backward compat (deprecated)
   Sink<MutationDocument<MyDoc>, Future<Done>> sink = 
CouchbaseSink.insertDocF(options);
   ```
   
   <!-- START COPILOT ORIGINAL PROMPT -->
   
   
   
   <details>
   
   <summary>Original prompt</summary>
   
   
   ## Problem
   
   Several `javadsl` classes expose Scala types (`scala.concurrent.Future`, 
`scala.concurrent.duration.FiniteDuration`) in their public API signatures, 
making them difficult to use correctly from Java. Java users should receive 
`java.util.concurrent.CompletionStage` and `java.lang.Boolean` in place of 
their Scala equivalents.
   
   
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to