pjfanning commented on code in PR #165:
URL: 
https://github.com/apache/incubator-pekko-connectors/pull/165#discussion_r1225764006


##########
google-cloud-pub-sub-grpc/src/main/scala/org/apache/pekko/stream/connectors/googlecloud/pubsub/grpc/javadsl/GooglePubSub.scala:
##########
@@ -61,15 +62,20 @@ object GooglePubSub {
           .setStreamAckDeadlineSeconds(0)
           .build()
 
-        subscriber(mat, attr).client
+        val streamingPullResult: Source[StreamingPullResponse, NotUsed] = 
subscriber(mat, attr).client
           .streamingPull(
             Source
               .single(request)
               .concat(
                 Source
                   .tick(Duration.ZERO, pollInterval, subsequentRequest)
                   .mapMaterializedValue(cancellable.complete(_))))
-          .mapConcat(_.getReceivedMessagesList)
+
+        streamingPullResult
+          .mapConcat(new function.Function[StreamingPullResponse, 
java.util.List[ReceivedMessage]] {

Review Comment:
   ```
   [error] -- [E007] Type Mismatch Error: 
/Users/pj.fanning/code/incubator-pekko-connectors/google-cloud-pub-sub-grpc/src/main/scala/org/apache/pekko/stream/connectors/googlecloud/pubsub/grpc/javadsl/GooglePubSub.scala:75:21
 
   [error] 75 |          .mapConcat((response: StreamingPullResponse) => 
response.getReceivedMessagesList)
   [error]    |                     
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   [error]    |         Found:    com.google.pubsub.v1.StreamingPullResponse =>
   [error]    |           java.util.List[com.google.pubsub.v1.ReceivedMessage]
   [error]    |         Required: org.apache.pekko.japi.function.Function[
   [error]    |           com.google.pubsub.v1.StreamingPullResponse, ? <: 
Iterable[T]]
   [error]    |
   [error]    |         where:    T is a type variable with constraint 
   [error]    |
   [error]    | longer explanation available when compiling with `-explain`
   ```
   
   The issue is that the SAM code is the same syntax as a Scala lambda 
function. Whatever is autoconverting the Scala function to a Java function when 
using Scala2 compiler just does not happen when Scala3 compiler is used.



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